In need of a bit of shellish magic

Kevin D. Clark kclark at mtghouse.com
Fri Jun 2 17:00:01 EDT 2006


Ted Roche <tedroche at tedroche.com> writes:

> I've just put a subversion repository on line and would like to make
> daily backups of it. That's pretty easy, a cron job at 2 AM with:
>
> svnadmin dump /path/to/repos >svndump20060602
>
> However, it would be convenient if the file name incremented year
> month and day automatically. Is there a built in bash feature to
> create a file name like that or should I look at a perl/python script?

Of course another way to do it could be:

svnadmin dump /path/to/repos | gzip -9c >svndump`perl -e '($y,$m,$d) = ((localtime)[5,4,3]); printf "%d%.2d%.2d", $y+1900, $m+1, $d'`

Enjoy,

--kevin
-- 
GnuPG ID: B280F24E                     And the madness of the crowd
alumni.unh.edu!kdc                     Is an epileptic fit
                                       -- Tom Waits




More information about the gnhlug-discuss mailing list