homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

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

Any ideas?





 12:35 pm on Mar 10, 2005 (gmt 0)

Hi Oz,

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.



Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved