Here is my suggestion;

Begin script here-----------------------------------------------------------
#! /bin/bash

TarFile=/home/user1/backup-`date +%a-%d-%m-%y`.tgz

tar -czvf $TarFile \
/home/user1/.Maildir/  \
/home/user2/.Maildir/  \
/home/user3/.Maildir/ 

End script here-----------------------------------------------------------

Comments: Note the use of the backslash. This is an escape character telling 
the script to ignore the newline character as the end of the command. This 
makes long commands more human readable.

The variable $TarFile contains a date stamp derived from the date command and 
ends up as the tar file name.

My version of the script uses mkisofs to create a cdrom image of the tar file 
and cdrecord to burn the image to disk.

The -v (verbose) switch in the tar command is optional.

Cheers Ross Drummond

On Sat, 26 Mar 2005 21:36, Jamie Dobbs wrote:
> I would like to set up a simple "backup script" that will tar/gzip the
> contents of the ~/Maildir directories of several users on one of my
> Linux boxes.
>
> Jamie

Reply via email to