Backup Script weird tar message

Binish A.R arbinish at yahoo.com
Wed May 21 19:08:57 UTC 2008


try the -P option.

       -P, --absolute-names
              don't strip leading `/'s from file names


--- On Mon, 2/4/08, Dubh Aingeal <ubuntu at dubh-aingeal.com> wrote:
From: Dubh Aingeal <ubuntu at dubh-aingeal.com>
Subject: Backup Script weird tar message
To: ubuntu-users at lists.ubuntu.com
Date: Monday, February 4, 2008, 12:08 AM

So I am working on a shell script to do a incremental backups. The 
script basically makes a full monthly backup then once a week makes 
another full back up with daily incremental backups. To limit the 
storage amount of backups, the script rewrites the weekly/daily backups. 
Eventually I want to add exclusions into it but that will be later 
(unless someone has some suggestions now). :p When I run the script to 
test it I get this message:

/bin/tar: Removing leading `/' from member names

I'm not sure whats causing it. I'm hoping some fresh eyes might see 
where I made my error.

The script looks like this:

#!/bin/sh
# full and incremental backup script
#Change the 5 variables below to fit your computer/backup

COMPUTER=executioner                            # name of this computer
DIRECTORIES="/home/aingeal"                  # directories to backup
BACKUPDIR=/backups                              # where to store the backups
TIMEDIR=/backups/last-full                         # where to store time 
of full backup
TAR=/bin/tar                                                # name and 
location of tar

#You should not have to change anything below here

PATH=/usr/local/bin:/usr/bin:/bin
DOW=`date +%a`                          # Day of the week e.g. Mon
DOM=`date +%d`                          # Date of the Month e.g. 27
DM=`date +%d%b`                        # Date and Month e.g. 27Sep

# Monthly full backup
if [ $DOM = "01" ]; then
        NEWER=""
        $TAR $NEWER -cf $BACKUPDIR/$COMPUTER-$DM.tar $DIRECTORIES
fi

# Weekly full backup
if [ $DOW = "Sun" ]; then
        NEWER=""
        NOW=`date +%d-%b`

        # Update full backup date
        echo $NOW > $TIMEDIR/$COMPUTER-full-date
        $TAR $NEWER -cf $BACKUPDIR/$COMPUTER-$DOW.tar $DIRECTORIES

# Make incremental backup - overwrite last weeks
else

        # Get date of last full backup
        NEWER="--newer `cat $TIMEDIR/$COMPUTER-full-date`"
        $TAR $NEWER -cf $BACKUPDIR/$COMPUTER-$DOW.tar $DIRECTORIES
fi

-- 
ubuntu-users mailing list
ubuntu-users at lists.ubuntu.com
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20080521/649d7c51/attachment.html>


More information about the ubuntu-users mailing list