LinuxSA Mailing list archives

Index: [thread] [date] [subject] [author]
  From: Jake Hawkes <jake@eclectic.com.au>
  To  : Nick Stock <nstock@netstarnetworks.com>
  Date: Mon, 21 Feb 2000 11:35:17 +1030

Re: Date stamp

Nick Stock wrote:
> 
> Hi all,
> 
> I am trying to use a shell script (via cron) to create a backup file
> every day and I would like the filename to contain the date.
> 
> Something along the lines of... backup-000221.tgz
> 
> How can I go about this?
> Does anyone know of any good examples on how to do this.
> My shell programming experience is limited.
> 
> Thanks,
> 
> Nick
> RJ-45 of all trades.
> 
> --
> LinuxSA WWW: http://www.linuxsa.org.au/  IRC: #linuxsa on irc.linux.org.au
> To unsubscribe from the LinuxSA list:
>   mail linuxsa-request@linuxsa.org.au with "unsubscribe" as the subject

#!/bin/bash
tar czf /backup-dir/backup_`date +%y%m%d`.tgz /data2save/*


--
Jake Hawkes, B.Eng (CSE)

"I'm only smart enough to know how stupid I am", Joe Strummer.

-- 
LinuxSA WWW: http://www.linuxsa.org.au/  IRC: #linuxsa on irc.linux.org.au
To unsubscribe from the LinuxSA list:
  mail linuxsa-request@linuxsa.org.au with "unsubscribe" as the subject


Index: [thread] [date] [subject] [author]
Return to the LinuxSA Mailing List Information Page