| Welcome to WebmasterWorld Guest from 18.104.22.168 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Become a Pro Member|
|Creating a bash script - DB Cron Job|
| 12:05 pm on Mar 10, 2005 (gmt 0)|
I've got this line of code which enables me to backup the database on a daily basis. However this does not work and I know why after all this time.
You need to login as root to run the command, now I think I need to create a bash script that enables you to login as root and then run the command.
Then I suppose you need to setup a cron job so that it executes the bash script at a given time. Yeah?
This is the line of code:
30 09 * * * /usr/bin/mysqldump --opt -uusername -ppassword dbname ¦ gzip > /home/sites/domain.com/web/mysqlbackup_`date +\%d\%m\%y`.sql.gz
| 12:35 pm on Mar 10, 2005 (gmt 0)|
Why don't you put that into root's crontab?
There again I don't see why this should fail, is there a permissions problem?
| 2:42 pm on Mar 10, 2005 (gmt 0)|
IncyWincy, that worked a treat! thanks for that, I didn't think of using the root crontab.
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved