Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: [CentOS] Cronjob script with date stamp?

From: Alain Spineux <aspineux(at)gmail.com>
Date: Thu Oct 25 2007 - 11:41:11 EDT


On 10/25/07, Scott Ehrlich <scott@mit.edu> wrote:
> I have a cron job that calls a shell script - the script invokes dump.
>
> I'd like to do two things:
>
> - Have the script dump the results of the job to a text file. I tried
> this with /path/to/dump my switches -v >> /home/me/dump.log
>
> But that just produced an empty file.

And if you try to include error too using 2>&1 :

/path/to/dump my switches -v >> /home/me/dump.log 2>&1

>
>
> - Have the dump file be date-stamped with the date it was executed. Right
> now, I manually edit the script to change the filename to the date the
> dump will be taken.

something like :

echo `date +%F` > /tmp/dump-`date +%F`

>
>
> To get a differential dump, would I have dump produce its output to the
> same file each time? I would not want to overwright the existing
> contents. I'm currently dumping to a file on an external hard drive, but
> will eventually go to tape.
>
> Thanks for feedback.
>
> Scott
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>

-- 
Alain Spineux
aspineux gmail com
May the sources be with you
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
Received on Thu Oct 25 11:41:49 2007

This archive was generated by hypermail 2.1.8 : Fri Jul 04 2008 - 01:07:38 EDT

Do you need help?X

Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library