FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 02-03-2008, 08:52 PM
Gerald Dachs
 
Default Backup Script weird tar message

Am Sun, 03 Feb 2008 13:38:17 -0500
schrieb Dubh Aingeal <ubuntu@dubh-aingeal.com>:

> 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). When I run the
> script to test it I get this message:
>
> /bin/tar: Removing leading `/' from member names

This is no error, it is a feature. If tar wouldn't do this and
you would unpack this archive later in a subdir then tar would
ignore the subdir and overwrite you / file system.

Gerald

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-03-2008, 09:17 PM
Nils Kassube
 
Default Backup Script weird tar message

Dubh Aingeal wrote:
> So I am working on a shell script to do a incremental backups.
> 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.

Like someone else mentioned already, that is the wanted behaviour of tar.
To get rid of the error message you could change the directories and make
them relative paths like this:

DIRECTORIES="home/aingeal"

Then, at the beginning of the script cd to the "/" directory.


Nils

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 05-21-2008, 07:08 PM
"Binish A.R"
 
Default Backup Script weird tar message

try the -P option.

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


--- On Mon, 2/4/08, Dubh Aingeal <ubuntu@dubh-aingeal.com> wrote:
From: Dubh Aingeal <ubuntu@dubh-aingeal.com>
Subject: Backup Script weird tar message
To: ubuntu-users@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). 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@lists.ubuntu.com
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/ubuntu-users--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 05-27-2008, 09:12 PM
"Preston Hagar"
 
Default Backup Script weird tar message

On Sun, Feb 3, 2008 at 1:38 PM, Dubh Aingeal <ubuntu@dubh-aingeal.com> wrote:
> 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.


As a somewhat side note (I think others have somewhat addressed your
question), I would highly recommend looking into hard links:

http://www.mikerubel.org/computers/rsync_snapshots/#Incremental

It is the way I have done incremental backups for a while and it is
great. Basically, the idea is that when you do daily (or weekly)
snapshots of a directory, you only make new copies of the files that
have changed. The files that are the same for the previous day's
snapshot are just hard linked. This basically just puts another
pointer to a file, instead of making two copies (and taking up more
space)

As an example of the space savings, one client I currently use this
method for (I use it a lot, including for my own backups) keeps 30
days of snapshots on a USB drive. One full day's backup uses 107 GB
of space, while all 30 days worth of backups are only using a total of
132 GB because there is only one copy of each version of each file.
Here is the backup script I use that might help out:

#!/bin/sh
exec > /var/log/hd_backup.log

echo "*****Backup Started: " `date`

# perform 30 days worth of snapshots. Add or remove
# mv lines to increase or decrease the number of snapshots
cd /mnt/ext_backup
rm -rf 30
mv 29 30
mv 28 29
mv 27 28
mv 26 27
mv 25 26
mv 24 25
mv 23 24
mv 22 23
mv 21 22
mv 20 21
mv 19 20
mv 18 19
mv 17 18
mv 16 17
mv 15 16
mv 14 15
mv 13 14
mv 12 13
mv 11 12
mv 10 11
mv 9 10
mv 8 9
mv 7 8
mv 6 7
mv 5 6
mv 4 5
mv 3 4
mv 2 3
mv 1 2

cp -al /mnt/ext_backup/current /mnt/ext_backup/1

# Touch the files to put a timestamp on the directory of the date that
# it was backed up.
touch /mnt/ext_backup/current
touch -r /mnt/ext_backup/current /mnt/ext_backup/1

# The two directories I backup on the system are /home and /etc
# The USB hard drive that the backup is copied to is mounted at
# /mnt/ext_backup

rsync -Crav --delete /home/ /mnt/ext_backup/current/data
rsync -Crav --delete /etc/ /mnt/ext_backup/current/etc

date=$(date +%Y-%m-%d)
echo "*****Backup Completed: " `date`

# END SCRIPT


Preston

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 10:30 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org