> > Thanks for the response, but what would be a better solution?
> 
> There are several possibilities, all of which equate to passing the
> list of files to backup to the tar command (or equivalent) via stdin
> rather than the command line.  Perhaps the simplest is to use the '-I'
> or '-T' flag to tar(1):
> 
>     find $FILES_DIR -xdev -type f -iname '*.bak' -print0 | \
>         tar --remove-files --null -T - \
>             -cvzpf $TAR_DIR/bak_files_`date +%F`.tar.gz
> 
> Other possibilities would include using cpio(1), which can be
> persuaded to emit tar format archives, or to build a perl backup
> script based around the File::Find and Archive::Tar modules.

Or passing the date in an environment variable.
I think something like

     datestamp=`date +%F`
     find $FILES_DIR -xdev -type f -iname '*.bak' -print0 | \
         tar --remove-files --null -T - \
             -cvzpf $TAR_DIR/bak_files_${datestamp}.tar.gz

should work.
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to