I use 7-Zip for full level 0 backups and wanted to implement level 1 and level 2 incremental backups, but this does not seem possible with 7-Zip. At the moment, it seems the only way of doing an incremental backup (level 1) is to compare the files in the directory structure to the files already in the original level 0 archive. This means that every incremental backup is level 1. I think that this is due to the way backup in 7-zip is implemented (using comparison to archive instead of using timestamp in the OS).
So, my request is: Can Igor implement a method of merging an incremental backup with the level 0 archive so that I can then do another level 1 archive which would in actuality be a level 2 archive.
Or
Can he not re-implement the whole incremental backup thing so that it goes compares timestamp/archive bit on the file in the OS instead of in the level 0 archive, which is how TAR works?
Or...is there something I have missed in current functionality to be able to do what I need?
--
Andrew
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It doesn't work for real incremental backups. I use the following command:
7z u backup_full.tar -u- -up0q0r2x0y2z0w0!backup_incremental.tar
to compare the files in the directories on disc to the files in backup_full.tar and to create backup_incremental.tar with the changes. It is true that I could use this command again to compare the files on disc to the backup_incremental.tar file, but this is dangerous because it will only compare the files that exist in the incremental file, and if a file has changed on disc that was in the original backup, but not the incremental backup, then the change will not be registered. It may be true that if you compare a whole directory, then this would work ok, but if you specify individual files in the backup set then you get into the situation I describe.
--
Andrew
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I find Igors comments very terse and they do not always help to figure out what he means when he writes such short comments. In this thread, I gave up replying because he is simply wrong.
-u- instructs 7-Zip to NOT update the base archive! So I am not updating it at all! The second dash after the -u performs this function. But even with that clarification, informing me that "Remove -u- switch. It will update backup_full.tar" does not in any way help with my original question, does it? I appreciate the new command line you sent, but I do not see what the difference is? ms=off just disables solid mode doesn't it? How does that help me to make a level 2 backup? Maybe I should try to explain what I want again....
I make a full backup of my docs.
I then want to make an incremental backup that just has the changes from the first backup. This is possible with 7-zip and it is really a differential backup, not an incremental backup.
Then, I want to make a third backup, that just has the changes made to my documents since the second backup was taken. This is called a level 2 or Son backup, and will be very familiar to people using Veritas Backup-Exec or any other professional backup program or RDBMS. This third backup, when used in conjunction with the first full backup and the second differential backup, will restore all files during a restore procedure, but it saves making a differential backup every day. /-zip cannot do this, it seems.
--
Andrew
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
2) then want to make an incremental backup
u Main.7z -u[...]!update1.7z
3) Then, I want to make a third backup,
u Main.7z -u[...]!update2.7z
> ms=off just disables solid mode doesn't it? How does that help me to make
a level 2 backup?
7-Zip can't update Main.7z in solid mode. You could use solid mode for new archive. But 7-zip's syntax now doesn't allow to split solid switches for archives in one command.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thankyou for your comments Igor, but it still does not give me what I want, because in your example, update2.7z is the same kind of backup as update1.7z. They are both differential backups containing the changes made since the original backup was created. Update2.7z will be at least the same size as update1.7z if not slighlty larger depending on how many changes have been made to files in the archive. Say that main.7z is 500Mb. After 3 days I make update1.7z and it is 100Mb. If i then create update2.7z as in your example, it will be at least 100Mb, but this is a waste of media space. I want update2.7z to be an incremental backup of the sum of changes contained in Main.7z and update1.7z, so that if only 5Mb of changes have been made since update1.7z then update2.7z will only be 5Mb and not 100Mb. The reason for having this setup is so that more frequent and quicker backups can be made instead of taking a full backup (or even an differential backup) every night, which would require massive storage (but obviously not in the example I give, as it would easily fit on 1 CD).
To make the point short, 7-Zip does not support incremental backups, only differential backups.
--
Andrew
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It looks like you're not familiar with serious backup requirements :)
In a business situation, Main.7z must not be changed, because a user may accidentally make horrendous screw-ups of data within a file, and not discover the problem until next opening the file, which could be a long time later.
When the damage is discovered, you need to search through the backups and find the last good version of that file; with the method you suggest, the good version would have been overwritten with a bad one.
The filesystem provides the archive bit (or attribute) so you can know what files have changed since the last backup.
Would it be practical to make 7-zip optionally use the filesystem's archive bit? To clear the archive bit when backing up a file, and read it to select a file for an incremental backup. Then 7-zip could easily do succesive incremental backups, just like any other backup program.
Clearing the archive bit would need great care - you have to be sure you have a good 7zip archive first, so maybe it should be done as the last step after the archive is finished, and also first verify the archive is OK on disk in case of bad media.
There could be two separate switches, one to read archive bit, one to clear it.
Then you can optionally do incremental backup but not change the archive bit.
This would allow you, for example, at night to run incremental 7-zip backup, then still do incremental tape backup afterwards.
(Tape backup program clears archive bits, ready for the next day).
And you can do the same the next night, and the next, and the next ...
Bit of overkill, having two backup systems, but I like the idea ;)
John
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks to all, especailly John on the details of all this.
Apparently I do not know all the differences between incremental and differential b.u.
Anyway here's a workaround that's simple enough until 7Zip gets its archive bit licks:
Make a master archive
Copy recent backup archives to remote folder - stores incremental/differential(?) backup archives
Delete recent backup archive from present folder
Make today's 'update' backup in present folder
BATCH FILE start ~~~~~~~~~~~~~~~~~~~~~
if exist "D:\Master.zip" goto UPDATE
D:\~Apps\7Zip\7z a -tzip "D:\Master.zip" @"D:\FileList.txt"
pause
goto END
:UPDATE
echo Copying recent Bak files to Sequential Bak directory
copy D:\Bak-*.zip c:\
del D:\Bak-*.zip
pause
D:\~Apps\7Zip\7z u -tzip "D:\Master.zip" -up0q3x2z0!"D:\BakRon-%date%.zip" @"D:\FileList.txt"
goto end
:END
BATCH FILE end ~~~~~~~~~~~~~~~~~~~~~
-----------------------------------------------------------------
Syntax from 7Zip Help File for Update function
7za u c:\1\exist.7z -u- -up0q3x2z0!c:\1\update.7z *
creates new archive update.7z and writes to this archive all files from current directory that differs
from files in exist.7z archive. exist.7z archive will not be changed.
7z u c:\1\exist.7z -up0q3x2z0!c:\1\update.7z * -ms=off
creates new archive update.7z and writes to this archive all files from current directory that differs
from files in exist.7z archive.
NOTES: To update .7z archive you must disable solid mode (-ms=off switch).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For the record: if you make
if exist "D:\Master.zip" goto UPDATE
D:\~Apps\7Zip\7z a -tzip "C:\Master.zip" @"D:\FileList.txt"
copy Master.zip Current.zip
pause
goto END
then you can create all backups in the storage directory without the slowdown of copying them each time with the exception of the master creation (which you do not do very often though).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I use 7-Zip for full level 0 backups and wanted to implement level 1 and level 2 incremental backups, but this does not seem possible with 7-Zip. At the moment, it seems the only way of doing an incremental backup (level 1) is to compare the files in the directory structure to the files already in the original level 0 archive. This means that every incremental backup is level 1. I think that this is due to the way backup in 7-zip is implemented (using comparison to archive instead of using timestamp in the OS).
So, my request is: Can Igor implement a method of merging an incremental backup with the level 0 archive so that I can then do another level 1 archive which would in actuality be a level 2 archive.
Or
Can he not re-implement the whole incremental backup thing so that it goes compares timestamp/archive bit on the file in the OS instead of in the level 0 archive, which is how TAR works?
Or...is there something I have missed in current functionality to be able to do what I need?
--
Andrew
With 7-zip you can create two archives by one command using -u switch:
1) Full_archive (updated from previous Full_archive)
2) Incremental_archive
But for .7z format you must disable solid mode.
It doesn't work for real incremental backups. I use the following command:
7z u backup_full.tar -u- -up0q0r2x0y2z0w0!backup_incremental.tar
to compare the files in the directories on disc to the files in backup_full.tar and to create backup_incremental.tar with the changes. It is true that I could use this command again to compare the files on disc to the backup_incremental.tar file, but this is dangerous because it will only compare the files that exist in the incremental file, and if a file has changed on disc that was in the original backup, but not the incremental backup, then the change will not be registered. It may be true that if you compare a whole directory, then this would work ok, but if you specify individual files in the backup set then you get into the situation I describe.
--
Andrew
Remove -u- switch. It will update backup_full.tar
7z u backup_full.tar -ms=off -up0q0r2x0y2z0w0!backup_incremental.tar
But if you update backup_full.tar, why would you need an incremental?
tja
I find Igors comments very terse and they do not always help to figure out what he means when he writes such short comments. In this thread, I gave up replying because he is simply wrong.
-u- instructs 7-Zip to NOT update the base archive! So I am not updating it at all! The second dash after the -u performs this function. But even with that clarification, informing me that "Remove -u- switch. It will update backup_full.tar" does not in any way help with my original question, does it? I appreciate the new command line you sent, but I do not see what the difference is? ms=off just disables solid mode doesn't it? How does that help me to make a level 2 backup? Maybe I should try to explain what I want again....
I make a full backup of my docs.
I then want to make an incremental backup that just has the changes from the first backup. This is possible with 7-zip and it is really a differential backup, not an incremental backup.
Then, I want to make a third backup, that just has the changes made to my documents since the second backup was taken. This is called a level 2 or Son backup, and will be very familiar to people using Veritas Backup-Exec or any other professional backup program or RDBMS. This third backup, when used in conjunction with the first full backup and the second differential backup, will restore all files during a restore procedure, but it saves making a differential backup every day. /-zip cannot do this, it seems.
--
Andrew
a Main.7z
2) then want to make an incremental backup
u Main.7z -u[...]!update1.7z
3) Then, I want to make a third backup,
u Main.7z -u[...]!update2.7z
> ms=off just disables solid mode doesn't it? How does that help me to make
a level 2 backup?
7-Zip can't update Main.7z in solid mode. You could use solid mode for new archive. But 7-zip's syntax now doesn't allow to split solid switches for archives in one command.
Thankyou for your comments Igor, but it still does not give me what I want, because in your example, update2.7z is the same kind of backup as update1.7z. They are both differential backups containing the changes made since the original backup was created. Update2.7z will be at least the same size as update1.7z if not slighlty larger depending on how many changes have been made to files in the archive. Say that main.7z is 500Mb. After 3 days I make update1.7z and it is 100Mb. If i then create update2.7z as in your example, it will be at least 100Mb, but this is a waste of media space. I want update2.7z to be an incremental backup of the sum of changes contained in Main.7z and update1.7z, so that if only 5Mb of changes have been made since update1.7z then update2.7z will only be 5Mb and not 100Mb. The reason for having this setup is so that more frequent and quicker backups can be made instead of taking a full backup (or even an differential backup) every night, which would require massive storage (but obviously not in the example I give, as it would easily fit on 1 CD).
To make the point short, 7-Zip does not support incremental backups, only differential backups.
--
Andrew
2) u Main.7z -u[...]!update1.7z
Main.7z = Main.7z (previous version) + new files
update1.7z = new files
3) u Main.7z -u[...]!update2.7z
Main.7z = Main.7z (previous version from step 2) + + new files
update2.7z = new files
Hi Igor
It looks like you're not familiar with serious backup requirements :)
In a business situation, Main.7z must not be changed, because a user may accidentally make horrendous screw-ups of data within a file, and not discover the problem until next opening the file, which could be a long time later.
When the damage is discovered, you need to search through the backups and find the last good version of that file; with the method you suggest, the good version would have been overwritten with a bad one.
The filesystem provides the archive bit (or attribute) so you can know what files have changed since the last backup.
Would it be practical to make 7-zip optionally use the filesystem's archive bit? To clear the archive bit when backing up a file, and read it to select a file for an incremental backup. Then 7-zip could easily do succesive incremental backups, just like any other backup program.
Clearing the archive bit would need great care - you have to be sure you have a good 7zip archive first, so maybe it should be done as the last step after the archive is finished, and also first verify the archive is OK on disk in case of bad media.
There could be two separate switches, one to read archive bit, one to clear it.
Then you can optionally do incremental backup but not change the archive bit.
This would allow you, for example, at night to run incremental 7-zip backup, then still do incremental tape backup afterwards.
(Tape backup program clears archive bits, ready for the next day).
And you can do the same the next night, and the next, and the next ...
Bit of overkill, having two backup systems, but I like the idea ;)
John
I suppose 7-zip will be able to use "archive bit" in some future versions.
Time to start a new project for an open source serious backup software featuring 7zip? lol :)
You don't need to.
Try:
MyZippa: http://www.saintlysoft.com/
Abakt: http://www.xs4all.nl/~edienske/abakt/index.html
I just installed and uninstalled Saintly Soft My Zippa. It has a virus that wanted to steal all my email addresses. be Warned
Thanks to all, especailly John on the details of all this.
Apparently I do not know all the differences between incremental and differential b.u.
Anyway here's a workaround that's simple enough until 7Zip gets its archive bit licks:
Make a master archive
Copy recent backup archives to remote folder - stores incremental/differential(?) backup archives
Delete recent backup archive from present folder
Make today's 'update' backup in present folder
BATCH FILE start ~~~~~~~~~~~~~~~~~~~~~
if exist "D:\Master.zip" goto UPDATE
D:\~Apps\7Zip\7z a -tzip "D:\Master.zip" @"D:\FileList.txt"
pause
goto END
:UPDATE
echo Copying recent Bak files to Sequential Bak directory
copy D:\Bak-*.zip c:\
del D:\Bak-*.zip
pause
D:\~Apps\7Zip\7z u -tzip "D:\Master.zip" -up0q3x2z0!"D:\BakRon-%date%.zip" @"D:\FileList.txt"
goto end
:END
BATCH FILE end ~~~~~~~~~~~~~~~~~~~~~
-----------------------------------------------------------------
Syntax from 7Zip Help File for Update function
7za u c:\1\exist.7z -u- -up0q3x2z0!c:\1\update.7z *
creates new archive update.7z and writes to this archive all files from current directory that differs
from files in exist.7z archive. exist.7z archive will not be changed.
7z u c:\1\exist.7z -up0q3x2z0!c:\1\update.7z * -ms=off
creates new archive update.7z and writes to this archive all files from current directory that differs
from files in exist.7z archive.
NOTES: To update .7z archive you must disable solid mode (-ms=off switch).
For the record: if you make
if exist "D:\Master.zip" goto UPDATE
D:\~Apps\7Zip\7z a -tzip "C:\Master.zip" @"D:\FileList.txt"
copy Master.zip Current.zip
pause
goto END
then you can create all backups in the storage directory without the slowdown of copying them each time with the exception of the master creation (which you do not do very often though).
is it possible to implement a wildcard in base_archive_name?
e.g.
7z a -r base-*.7z -u- -up0q3r2x0y2z0w2!diff.7z src\*
ren diff.7z base-%time%.7z src\*
mike_a
I fully agree with Andrew: "7-Zip does not support incremental backups".
And this is the only reason why I don't use 7-Zip.
Could you add two command line switches? For example:
-ao
(Archive Only) Add to archive only directory/files with "Archive" attribute.
-ac
(Archive Clear) Clear "Archive" attribute after creating the archive.
This will be enough. I will be happy. :)