[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: How do I do this in bash ??



[jeremy@MERCURY:pts/1:~]$ crontab -l
0 8 * * *               /home/jeremy/bin/backupmail.sh

[jeremy@MERCURY:pts/1:~]$ cat ~jeremy/bin/backupmail.sh
#!/bin/bash

FILENAME=/home/jeremy/backups/mail/`date -I`.tar

cd ~jeremy/
/bin/tar -chf $FILENAME mail/*

HTH,
j.

--
Jeremy L. Gaddis   <jeremy@gaddis.org>   <http://www.gaddis.org>



> -----Original Message-----
> From: Dave Selby [mailto:dave_arahan@yahoo.co.uk]
> Sent: Sunday, January 19, 2003 5:49 AM
> To: Debian
> Subject: How do I do this in bash ??
>
>
> Hi all ...
>
> I am writting a weekly automated backup script, very simple .. tars a
> directory called 'myfiles' to a second hard drive.
>
> Works AOK except I want the name of the file written by tar
> to be the time
> and date. So I get a list of tared dated backups
>
> I know 'date' gives me exactly what I want but I cant figure
> out how to get
> tar to write a file with the value of date as its file name ...
>
>
> #! /bin/sh
>
> # Backup entire 'myfiles/' directory, name it with the date.
>
> cd /usr/local/
> tar -czf /mnt/archive/autoarchive/date myfiles
>
>
> I put this in /etc/cron.weekly and I get a file called date !!???
> I have tried '' and "" all to no avail
>
> Any hints ??
> Dave
>
>
> --
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact
> listmaster@lists.debian.org
>



Reply to: