Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
i'm trying to write a simple backup script
using rsync, tar and crontab .. but i want to
be able to rename a newly created
archive with the current date .. could
anyone point me in the right direction
please? thanks

I sometimes use dates in file naming, but I prefer sequential numbering since that is unique, and I still have the date stamp of the file to show me when it was created. When using dates, consider including hour and min, and maybe even sec. Following example uses only ymd. The nested command in back apostrophes is replaced by its output:
outfile=backup_`date +%Y%m%d`
/etc/fbackup -f $outfile ...
compress $outfileIf the utility does not let you name the output, but instead always outputs to some default file name, you can rename it after creation:
outfile=backup_`date +%Y%m%d`
/etc/mybackup_utility
mv backup.out $outfile
compress $outfile

![]() |
Lost MOUSE on ultra5 afte...
|
Question related to unix ...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |