CatsRninja
August 5th, 2009, 10:39 PM
hello everyone,
I`m trying to create an automatic backup script using the tar command.
Heres the algorythm(kinda) of what i have in mind.
1rst time:
1-backsup `tar -cf (name) (backupfolders)`
2-gzip name
2cond time backup:
1-search for previous backup,
if not there, run a 1rst time backup END
2- unzip previous backup;
3- tar -uf (name) (backupFolders)
4-zip backupfile
The point that bothers me, is the 2cond time 3rd tar, with the -u (update) saves a new copy of a file, example:
you have t.txt in the backup, you modify t.txt, so update updates the new t.txt, but doesnt delete the old one,
I dont want that to happen.
the new t.txt should override the last t.txt.
I hope i`ve been clear.
I`m trying to create an automatic backup script using the tar command.
Heres the algorythm(kinda) of what i have in mind.
1rst time:
1-backsup `tar -cf (name) (backupfolders)`
2-gzip name
2cond time backup:
1-search for previous backup,
if not there, run a 1rst time backup END
2- unzip previous backup;
3- tar -uf (name) (backupFolders)
4-zip backupfile
The point that bothers me, is the 2cond time 3rd tar, with the -u (update) saves a new copy of a file, example:
you have t.txt in the backup, you modify t.txt, so update updates the new t.txt, but doesnt delete the old one,
I dont want that to happen.
the new t.txt should override the last t.txt.
I hope i`ve been clear.