make firefox backup a bit smaller

This commit is contained in:
Ingolf Wagner 2023-11-06 11:46:59 +01:00
parent 9eaf97ef0e
commit 8f4f86aa37
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B

View file

@ -110,30 +110,34 @@ let
name = name;
source = home;
target = backupHome;
arguments = [
"--exclude=Downloads"
"--exclude=.cache"
"--exclude=\".config/*chrom*/*cache\""
"--exclude=\".config/*chrom*/Crash Reports\""
"--exclude=\".config/*chrom*/Default/DawnCache\""
"--exclude=\".config/*chrom*/Default/IndexedDB\""
"--exclude=\".config/*chrom*/Default/Local Storage\""
"--exclude=\".config/*chrom*/Default/Service Worker/CacheStorage\""
"--exclude=\".config/*chrom*/Default/Storage\""
"--exclude=\".config/*chrom*/Default/optimization_guide_prediction_model_downloads\""
"--exclude=\".mozilla/firefox/*.default/*cache*\""
"--exclude=\".mozilla/firefox/*.default/sessionstore-backups\""
"--exclude=\".mozilla/firefox/*.default/storage-sync-v2.sqlite\""
"--exclude=\".mozilla/firefox/*.default/storage/to-be-removed\""
excludes = [
"Downloads"
".cache"
".config/*chrom*/*cache"
".config/*chrom*/Crash Reports"
".config/*chrom*/Default/DawnCache"
".config/*chrom*/Default/IndexedDB"
".config/*chrom*/Default/Local Storage"
".config/*chrom*/Default/Service Worker/CacheStorage"
".config/*chrom*/Default/Storage"
".config/*chrom*/Default/optimization_guide_prediction_model_downloads"
".mozilla/firefox/*.default/*cache*"
".mozilla/firefox/*.default/crashes"
".mozilla/firefox/*.default/datareporting"
".mozilla/firefox/*.default/sessionstore-backups"
".mozilla/firefox/*.default/storage-sync-v2.sqlite"
".mozilla/firefox/*.default/storage/temporary"
".mozilla/firefox/*.default/storage/to-be-removed"
".mozilla/firefox/Crash Reports"
];
};
createBackupScriptTemplate = { sudo, name, source, target, arguments ? [ ] }:
createBackupScriptTemplate = { sudo, name, source, target, excludes ? [ ] }:
pkgs.writers.writeBashBin "${name}-backup"
''
sudo -u ${sudo} \
${tarBin} \
${concatStringsSep " " arguments} \
${concatStringsSep " " (map (pattern: "--exclude=\"${pattern}\"") excludes)} \
--create \
--verbos \
--lzma \