gavinw007
asked on
Incremental Backups And Full Backups
Hi,
I have created a script to do incremental backups as per below...
#!/bin/bash
days=1
dmy=$(date +%d%m%Y)
cd /test
find /home -mtime -$days -print | tar zvcf /test/backup.${dmy}.${days }.tgz -T -
This works fine BUT for some reason it makes 2 extra copies and i cant figure out why so in my backkup.tgz file i see...
/home/joe/data
/home/joe/data
Which is making my backups double the size, has anyone got any solutions as to why this is happening? or have they got a better way of doing incremental then a full backup?
Thanks for any assistance!
Gav
I have created a script to do incremental backups as per below...
#!/bin/bash
days=1
dmy=$(date +%d%m%Y)
cd /test
find /home -mtime -$days -print | tar zvcf /test/backup.${dmy}.${days
This works fine BUT for some reason it makes 2 extra copies and i cant figure out why so in my backkup.tgz file i see...
/home/joe/data
/home/joe/data
Which is making my backups double the size, has anyone got any solutions as to why this is happening? or have they got a better way of doing incremental then a full backup?
Thanks for any assistance!
Gav
ASKER
Hi,
could you kindly post an example, as im having alot of problems :-) sorry for being a newbie!
Gav
could you kindly post an example, as im having alot of problems :-) sorry for being a newbie!
Gav
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi,
Sorry for delay... I have tried the above dump commands i can do that fine but for some reason i cannot use the restore to restore my file, have check out the man pages but it seems to be looking for a tape drive.
Think we are nearly there tho
Thanks again :-)
Gav
Sorry for delay... I have tried the above dump commands i can do that fine but for some reason i cannot use the restore to restore my file, have check out the man pages but it seems to be looking for a tape drive.
Think we are nearly there tho
Thanks again :-)
Gav
I think you need to use the -A option to tell it where to find your dump files. Have you tried that?
Both find and tar are recursing through the directories. From the tar manpage, "The use of a directory name always implies that the subdirectories below should be included in the archive". Using find for directories might not be the best idea here.
Some gnu tar options you might want to look at:
-G, --incremental : create/list/extract old GNU-format incremental backup
-g, --listed-incremental F : create/list/extract new GNU-format incremental backup
-N, --after-date DATE, --newer DATE: only store files newer than DATE