Hi,

> I want to backup my mail at the beginning of every month with a cronjob,
> <...>
>
> * 0 1 1-12 * mv /home/deklown/Msgs/backup-inbox
> /home/deklown/Msgs/backup-`date +Y-%m` |gzip
> 
> I am not sure what to do after this
> 
> maybe ...|gzip -9 $1

Just take this (all written in ONE line):

* 0 1 1-12 * cd /home/deklown/Msgs ; gzip -c9 backup-inbox > backup-`date +Y-%m`
             && cat /dev/null > backup-inbox

But take care, you don't habe a second chance!
Another problem seems to be your time spec. It reads like EVERY minute in the
first hour of the first day in every month. 
You should better write it "27 3 1 * *" to run it at 3:27am (randomly selected)
on the first day of month.
Alternatively you can choose "@monthly" to run your script at 0:00 on the fist
of month (see manpage crontab(5))

Ciao for now, Dirk
--
Dirk Ruediger, Rostock, Germany
 
Eli and Bessie went to sleep.
In the middle of the night, Bessie nudged Eli.
        "Please be so kindly and close the window.  It's cold outside!"
Half asleep, Eli murmured,
        "Nu ... so if I'll close the window, will it be warm outside?"

Reply via email to