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; name = name;
source = home; source = home;
target = backupHome; target = backupHome;
arguments = [ excludes = [
"--exclude=Downloads" "Downloads"
"--exclude=.cache" ".cache"
"--exclude=\".config/*chrom*/*cache\"" ".config/*chrom*/*cache"
"--exclude=\".config/*chrom*/Crash Reports\"" ".config/*chrom*/Crash Reports"
"--exclude=\".config/*chrom*/Default/DawnCache\"" ".config/*chrom*/Default/DawnCache"
"--exclude=\".config/*chrom*/Default/IndexedDB\"" ".config/*chrom*/Default/IndexedDB"
"--exclude=\".config/*chrom*/Default/Local Storage\"" ".config/*chrom*/Default/Local Storage"
"--exclude=\".config/*chrom*/Default/Service Worker/CacheStorage\"" ".config/*chrom*/Default/Service Worker/CacheStorage"
"--exclude=\".config/*chrom*/Default/Storage\"" ".config/*chrom*/Default/Storage"
"--exclude=\".config/*chrom*/Default/optimization_guide_prediction_model_downloads\"" ".config/*chrom*/Default/optimization_guide_prediction_model_downloads"
"--exclude=\".mozilla/firefox/*.default/*cache*\"" ".mozilla/firefox/*.default/*cache*"
"--exclude=\".mozilla/firefox/*.default/sessionstore-backups\"" ".mozilla/firefox/*.default/crashes"
"--exclude=\".mozilla/firefox/*.default/storage-sync-v2.sqlite\"" ".mozilla/firefox/*.default/datareporting"
"--exclude=\".mozilla/firefox/*.default/storage/to-be-removed\"" ".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" pkgs.writers.writeBashBin "${name}-backup"
'' ''
sudo -u ${sudo} \ sudo -u ${sudo} \
${tarBin} \ ${tarBin} \
${concatStringsSep " " arguments} \ ${concatStringsSep " " (map (pattern: "--exclude=\"${pattern}\"") excludes)} \
--create \ --create \
--verbos \ --verbos \
--lzma \ --lzma \