On Tue, 30 Jan 2001, Cameron Simpson wrote:
<snip>
> Or you can do this:
> 
>       day=`date '+%Y-%m-%d'`
>       now=`date '+%Y-%m-%d-%H:%M:%S'`
>       mkdir "$day" || mkdir "$now" || exit 1
> 
> Those are short circuiting OR operators, this make the first choice or
> if not then make the second or if not then abort.
> 
> Of course, you want to know which dir you ended up with, so maybe:
> 
>       day=`date '+%Y-%m-%d'`
>       now=`date '+%Y-%m-%d-%H:%M:%S'`
> 
>          { mkdir "$day" && dir=$day; } \
>       || { mkdir "$now" && dir=$now; } \
>       || exit 1
> 
>       cp stuff into $dir

I am using a perl script someone posted to Freshmeat a while back. It is
called run-backup. Do a search for it on freshmeat. I have it running from
a cron job.

Jack




_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to