Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

crontab redirect 1

Status
Not open for further replies.

jwhausk

Technical User
Jun 18, 2002
18
US
I am trying to run some backups using a cron job, the backups are running but when I try to redirect the output listing to a file the file is created but there is no data in it. What do I have set wrong?

Here are the entries I have set up in crontab to run my backup

0 15 * * * /projects/cronscripts/bu-vitd >> /tmp/vitd-log
4 0 * * * /projects/cronscripts/rename

The 1st line runs a script to run some tars of specific files, then I want it to send the output to a text file for review.
The tar is running properly but the /tmp/vitd-log is empty (the file is created but contains no data).

****** the script **************
cd /projects
tar cvf /dev/rmt/tps1d6 vitd
mt -f /dev/rmt/tps1d6 unload

The second line runs a script to rename the file, this does work but, is the a better way of accomplishing this?

****** the script **************
mv /tmp/vitd-log /projects/vitd-logs/daily-log.`date +%y%m%d`

Thanks for your help.

Have a Great Day,
John
 
try the following

0 15 * * * /projects/cronscripts/bu-vitd > /tmp/vtd.log 2>&1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top