Skip to content

Instantly share code, notes, and snippets.

@StoneLabs
Created December 9, 2021 15:14
Show Gist options
  • Save StoneLabs/4ef8c425b3442df955d237db1652a028 to your computer and use it in GitHub Desktop.
Save StoneLabs/4ef8c425b3442df955d237db1652a028 to your computer and use it in GitHub Desktop.
backup.sh
7z u old.zip -u- -up0q0x2!new.zip /foler_to_backup/
# https://sevenzip.osdn.jp/chm/cmdline/switches/update.htm
# Flags:
# p0,q0 = dont copy files not existing on disk
# x2 = compress files from disk even if they are newer in the archive
# Inherited by -u:
# r2 = compress files not in archive
# y2 = compress files newer on disk
# w2 = compress files with same date but different size
# z1 = copy files that are equal on disk
# old.zip will not be changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment