PDA

View Full Version : Cron job using the CP


vB3Dev.Com
Sat 5th Jul '03, 10:14am
Guys, I do not have SSH access but I do have cron access through my cp.

Can you guys tel me how to:

1. Do a cron job to back up my database every night around 4AM?

2. How to restore my database using same?

I do not know anything about cron, so please give exact details/syntax?

Thank you so much!

Max

Steve Machol
Sat 5th Jul '03, 12:22pm
1. mysqldump --opt -uDBUSER -pDBPASSWORD DBNAME > /path/to/backup.sql

2. mysql -uDBUSER -pDBPASSWORD DBNAME < /path/to/backup.sql

Honestly though I've never heard of anyone using a cron job to restore a backup. I assume you would only do this if something goes wrong, right?

vB3Dev.Com
Sat 5th Jul '03, 12:32pm
Steve, thank you soooooooooo much!

Can you also give me a unrar/unzip verion because most likely I will have to decompress the file...

Thanks guys. I love you all!

I have goten the best help on this site than any other!

I would use this to restore a backup because I do not have SSH access on some of my sites... :D

Steve Machol
Sat 5th Jul '03, 12:35pm
1. mysqldump --opt -uDBUSER -pDBPASSWORD DBNAME > /path/to/backup.sql; zip /path/to/backup.sql

2. mysql -uDBUSER -pDBPASSWORD DBNAME < /path/to/backup.sql; unzip /path/to/backup.sql

vB3Dev.Com
Sat 5th Jul '03, 12:50pm
Wow!
Thanks so much!!!!!

You guys are awsome!

Max