110mb.com Forum
News: Currently none. But refer to this news before you post an error, maybe it's already being fixed Wink
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 05, 2008, 01:20:43 AM


Login with username, password and session length


Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: automatic backup of selected folders in root via cron?  (Read 310 times)
iM1
Authority Member
****
Offline Offline

Posts: 795


Why drink and drive when you can smoke and fly...


WWW
« on: August 12, 2008, 03:06:48 PM »

I need a script that can make automatic backups of selected folders in my account and then .gzip them or better .bzip2 files and folders.  (bzip2 compressed my 80mb db into 5mb)

Once the script has been made i can easily make it run automatically using cron.
Logged

My site is worth
My Sites:
iM1 MUSIC // DesiDrop - Music Blogs
Satize.com - MP3 Search Engine NEW V2!
d3xt3r
Guest
« Reply #1 on: August 12, 2008, 03:11:00 PM »

I need a script that can make automatic backups of selected folders in my account and then .gzip them or better .bzip2 files and folders.  (bzip2 compressed my 80mb db into 5mb)

Once the script has been made i can easily make it run automatically using cron.

There are many of these types of scripts available. Searching would help you a lot.

Also, we don't know your hosts specifications or abilities.. Such as the ability to GZIP items. Since you don't host here.
Logged
iM1
Authority Member
****
Offline Offline

Posts: 795


Why drink and drive when you can smoke and fly...


WWW
« Reply #2 on: August 12, 2008, 03:13:52 PM »


Ok i'll have a quick search now for some.

I think my host can pretty much do all the common stuff, its paid hosting so it cant be crap Duh
Logged

My site is worth
My Sites:
iM1 MUSIC // DesiDrop - Music Blogs
Satize.com - MP3 Search Engine NEW V2!
Mop (Gb)
Loyal 110MB Member
*******
Online Online

Posts: 3672


PHP Coder


WWW
« Reply #3 on: August 12, 2008, 03:25:24 PM »

http://www.110mb.com/forum/timestamp-in-cronjob-backup-t33775.0.html

I'm guessing you use generic cPanel shared hosting...:
Summary:
Cron:
Code:
tar -cjf /home/yourUsername/backup.tar.bz2 /home/yourUsername/public_html
I suppose you'd want to label the day its from, so, to the end of that command,

php /home/yourUsername/renameBackup.php

renameBackup.php would be....
Code:
<?php
$newname
="/home/yourUsername/backup-" . date("U") . ".zip.bz2";
rename("/home/yourUsername/backup.tar.bz2", $newname);
?>

So, the cron altogether...

Code:
tar -cjf /home/yourUsername/backup.tar.bz2 /home/yourUsername/public_html; php /home/yourUsername/renameBackup.php


** I HAVEN'T TESTED THIS ** But I will right now... Tested!
« Last Edit: August 12, 2008, 03:38:50 PM by Mop (Gb) » Logged



Mop (Gb)
Loyal 110MB Member
*******
Online Online

Posts: 3672


PHP Coder


WWW
« Reply #4 on: August 12, 2008, 03:37:17 PM »

Ok, I tested it. The shared host I was on didn't have zip, so, most cPanel hosts being quite similar, I will assume that yours doesn't either, and use tar & bzip2 (Which is better anyways).

I've edited the post with a working version.
Logged



primefalcon
a title
Super Authority member
******
Offline Offline

Posts: 1919


Learn to code at w3schools.com


« Reply #5 on: August 12, 2008, 06:36:17 PM »

e can can run cron and shell scripts on 110mb? I thought that would of been blocked
Logged



TDSii
Best warez site!!
Super Authority member
******
Offline Offline

Posts: 1972


..:: skdown.net ::..


WWW
« Reply #6 on: August 12, 2008, 06:58:24 PM »

the idea is to check every visit for every user and if it passed the time it will run a script.
But the draw back that it is controlled by the user when he can terminate the php proccess any time he wants.
Cronjobs are no more than a folder inside linux where u can put bash scripts inside. Used them many times but never with php andmysql integrations.
Logged

inp o҉rtb
The Gangsta
Global Moderator
Official 110mb Guru
*****
Online Online

Posts: 11704


experimental theologian


WWW
« Reply #7 on: August 12, 2008, 11:56:46 PM »

e can can run cron and shell scripts on 110mb? I thought that would of been blocked

e cannot; you thought correctly.
Logged

Timothy Jacobs
Advanced Authority Member
*****
Online Online

Posts: 1048


"Welcome to the Grand Illusion" - STYX, 1977


WWW
« Reply #8 on: August 13, 2008, 12:12:54 AM »

e can can run cron and shell scripts on 110mb? I thought that would of been blocked
A quick reverse DNS would have told you he is not hosted here.
Logged





Pages: [1]   Go Up
  Send this topic  |  Print  
 
Jump to:  

  Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC

Theme by Dilber MC | Using SEO4SMF Mod

All content on this forum (especially posts) is copyright property of 110mb & the member
who wrote the post. So if you wish to steal anyone's post on this forum, you'll wish you
were dead because our lawyers will sue your ass!