FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Cron

 


WickedGravity
Alrighty,

I know a bunch of stuff about a bunch of stuff, but I will be damned if I can figure out Cron Jobs.

What I want to do is make a job that runs every twelve hours and backs up by database into my root directory.

The database name is myusername_phpb1 and it is updated pretty often and I have theis tendency to mess it up when I install mods.

I also want to make it so it will overwrite the previous backup.

Is this doable and can someone lend me a hand in doing it?
dionet
Well, I think you need to do a php script to copy the mysql db to another db and in cron job you need to set to run that php script
WickedGravity
If I can, I think what I need to do is this...

Code:

0 0 * * 0   mysqldump --add-drop-table -u username -ppassword phpbb > phpbb_backup.sql
Bondings
To execute a php script in a secured directory, use the following command line:

Code:
wget -O/dev/null -q --http-user=cronjob --http-passwd=phpfreakz http://www.foo.com/bar/my_secure_dir/myscript.php

You need to change the username, password and php file url.
dionet
well, but you need to set to twelve hours
WickedGravity
So doing this...

Code:

30 * * * * mysqldump –u <username> <database-name> > <backup-file-name> -p<password> | mv <backup-file-name> <directory-to-save-backup>

Wouldn't work?
Helios
look at me cron job tut about the hour configuration.

Bondings already gave you the cmd to exec.
techcheetah
great stuff guys...thanks
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.