LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

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

Rep: Reputation: 0
cronjob


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

Thanks,
-Ed
 
Old 04-12-2003, 09:52 PM   #2
pablob
Member
 
Registered: Apr 2003
Location: Madrid
Distribution: RHAS, Kubuntu, Solaris, TRU64
Posts: 381

Rep: Reputation: 31
#!/bin/bash

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 you@you.com
 
  


Reply


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


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

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