Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 04-12-2003, 12:25 AM   #1
LQ Newbie
Registered: Apr 2003
Posts: 1

Rep: Reputation: 0

I am running a cron job to backup a database.

1) Is there a way to have the file mailed to me?
2) How can I keep the old file from being overwritten each time the job runs? Can I have the filename change each time it runs?

I would like to run these as 2 separate jobs at different times to keep one set on the server and another off the server.

I have absolutely no clue what I'm doing.
Here is the command line I'm using now.

mysqldump -uXXXXX -pXXXXX -B XXdatabasenameXX> /home/XXXX/backup.sql

Old 04-12-2003, 09:52 PM   #2
Registered: Apr 2003
Location: Madrid
Distribution: RHEL, Kubuntu, Solaris, TRU64
Posts: 382

Rep: Reputation: 31

file = backup.sql.`date +%w`

mysqldump -uXXXXX -pXXXXX -B XXdatabasenameXX>/home/XXXX/$file
# Adds day of week number. For day of month: +%d

cat /home/XXXX/$file | mail -s Backup


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
cronjob problem chadi Linux - General 5 10-10-2004 09:09 PM
cronjob help meeh Linux - General 1 03-26-2004 11:41 AM
Cronjob engnet Linux - Networking 6 03-03-2004 09:21 AM
cronjob ugob Linux - Software 0 03-03-2004 09:20 AM
Su in a cronjob michedlp Programming 3 11-06-2003 08:30 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:03 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration