some confict between Variable Comments and the actually run
Closed this issue · 6 comments
There is some confict between Variable Comments and the actually run, and i also found if a filesize is 0,the script will leave the Achive bit to A no matter what backup mode is selected.
# diff : This option is generally used to perform the archiving of
# files in the selection paths that have changed after a previous
# backup (archive attribute set).
# At successfull archiving operation all archive attributes
# for all archived files are lowered.
Started on ........ : 11/12/2017 18:51:01
Backup Type ....... : diff
Files' Archive attr : Will stay unchanged
Selection File .... : C:\Scripts\AAC_7zbackup\AAC_backup_selection.txt
Destination ....... : E:\Backup
Archive Name ...... : DESKTOP-diff-20171112-185101.7z
Archive Type ...... : 7z
Rotation policy ... : Keep last 5 archive(s)
7zip binary ....... : C:\Program Files\7-Zip\7z.exe (ver. 16.04)
7zip threading .... : Auto
7zip Compression .. : Auto
As I can see from your posted sample you ran the script in "diff" mode. This is NOT meant to lower archive bit at every run. If you want to lower Archive bit you have to run in "incr" mode.
I will amend the comment as this
# diff : This option is generally used to perform the archiving of
# files in the selection paths that have changed after a previous
# Full backup (archive attribute set).
# At successfull archiving operation all archive attributes
# for all archived files are left unchanged.
Dear AndreaLanfranchi
Thank you for kindly reply,it seems that the incr sections need to be change accordingly in the comment
And another question is I found if a file cotains no content (size 0k), the Achive bit will never be lowerd(no matter which mode is selected),As a result the file will be backuped every time I run the script,can you verify that?
@JAM2199562 regarding your evidence about zero sized files I confirm this is an issue.
However is not script's fault but is a problem on 7zip side which does not output the name of zero sized files in it's compression log.
Will try to find a workaround.
As further addition please notice that this occurs only for archives of type 7z and 7zip 16.04
If you create the archive as a zip archive (./7zbackup.ps1 --archivetype zip) you get zero sized archives to be properly post processed.