Jump to content
MakeWebGames

Recommended Posts

Posted

Assuming you mean MySQL:

@daily mysqldump -uusername -ppassword database > /home/user/database-`date +%Y%m%d`.sql

For example:

@daily mysqldump -uxan -pnotmypass xandb1 > /home/xan/xandb1-`date +%Y%m%d`.sql

would produce the file

xandb1-20110727.sql

assuming I ran it when I posted this reply - but every day would produce a new .sql dumpfile with a different date-stamp.

Far from perfect, but it provides a limited backup capabaility. Look at the options to mysqldump to fine tune it.

@daily btw is equivalent to 0 0 * * *

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...