Operating System - HP-UX
1753468 Members
4604 Online
108794 Solutions
New Discussion юеВ

Incremental backup of directory

 
Vassily Gorbounov_1
Occasional Advisor

Incremental backup of directory

Hi, all.
I have a task of setting up an incremental backup.
It is realised now as:
1. Creating a list of files for backup
2. Making a TAR archive and then through the pipe - to gzip ( to avoid creating
multigigabyte archives).

At the first step I include in the list following items:
a. Files, newer then the tag file
b. Directories, if they are empty ( this is done for backup up new but empty
directories)

But it seems that another item is missed - it's the directory (not empty) which
has some files deleted since last backup.

The problem is - how to put in TAR information about decreased number of files
in the directory, not putting the whole directory contents to the archive.

Thank you
Vassily
8 REPLIES 8
Paul Heffels_1
Frequent Advisor

Re: Incremental backup of directory

Hi Vasily, I'm sorry but I have read your post several times without being able
to understand what you mean. Could you be a bit more specific?
Vassily Gorbounov_1
Occasional Advisor

Re: Incremental backup of directory

Sorry, Paul for uncomplete description.
It must be because of my poor english.

I'll try to explain:
1. My main task is to make an incremental backup of some directory. As an idea
I decided to make a list of files,which has been changed since last backup and
then make an archive with the tar for that files.

2. The list consists of three parts: changed files, new empty directories and
(the problem) - directories, number of files in which is decreased.

That is I need to include in incremental backup information about fileswhich
were deleted since last backup.
That's all.

This information contained in directory files, but I can't give a name of the
directory to the TAR program without that directory being archived in a whole.
But say I have a dir with 1000 files and then I delete one of them, leaving
others untouched. How can I include this information to the backup without
archiving all 999 remaining files.

Thanks .
Vassily
Paul Heffels_1
Frequent Advisor

Re: Incremental backup of directory

Hi Vassily,

I wonder why you would use tar to do an incremental backup. Is there a reason
why you don't want to use dump or fbackup? Because that would be my advise to
you.

I understand that you don't want to backup a whole directory if 1 file is
deleted. But what do you want to do with that deleted file? You can't backup
it. And you can't remove it from the tar file (if you would like to do that).

Maybe it's just because I don't have the whole picture here but if a file is
deleted from a directory, why would you want to do anything with that
directory? Do you want a list of deleted files? I would be very carefull with
the tape that contains the tape in case it was accidentely deleted.

In my simplicity I would say that you're better off with fbackup, do a
different level each day on a different tape or write it to a NoRewind device,
make a full backup every week and live happily ever after.

Hope this helped.
Vassily Gorbounov_1
Occasional Advisor

Re: Incremental backup of directory

Hi, Paul
Thanks a lot for your advice.
It's my fault that I didn't clarify exactly what I need.

My global task is to synchronize some directories in two servers (main and
backup), which located in different cities.
For that aim we can't use tapes - no possibility to transfer them back and
forth every night.

So we can't use dump or rdump.
And the general method is to create local compressed incremental backup set,
move it to other server and then extract all changes from archive.

So when I delete 1 file from directory on server1 I would like to have that
file deleted on server2 too.

That's my situation.
But You've still helped me a lot cause you adviced me to use fbackup and I
found out that it will do the necessary actions.

Thanks
Vassily
Paul Heffels_1
Frequent Advisor

Re: Incremental backup of directory

Hi Vassily,

Thanks for your feedback. I'm glad I was able to help. Now I finaly understand
what your problem is/was. As a matter of fact, I have some scripts here that do
exactly what you need because we have to perform a replication too. Let me know
if you're interested.

Regards,
Paul
Vassily Gorbounov_1
Occasional Advisor

Re: Incremental backup of directory

Hi, Paul
Surely it would be interesting to me to know how have you solved similar
problems.
And I would be glad if you will share your valuable knowledge.

Thanks
Vassily
Paul Heffels_1
Frequent Advisor

Re: Incremental backup of directory

Hi Vassily, I included the replication scripts to this post. I hope it's of any
use to you. Don't mind the chaotic script layout.
Alan Riggs_1
Regular Advisor

Re: Incremental backup of directory

It may be too late, but I believe the functionality you are both looking for is
most easily found in therdist utility. It is trivial to set up an rdist file
to synchronize directories across a network.