WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Some filetool.sh backup excludes  (Read 103 times)

Offline CNK

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 384
Some filetool.sh backup excludes
« on: July 24, 2025, 09:12:47 PM »
Some ways I shrunk my mydata.tgz backup size, which might be commonly desired.

Dbus built up a few megabytes of files in ~/.dbus/session-bus over the years which don't need to be kept.

I keep my Firefox data in mydata.tgz rather than symlinking ~/.mozilla to a physical drive since it makes it easy to copy the backups regularly and revert to old copies. But a lot of data in there now turned out to be junk:

  • ~/.mozilla/firefox/[profile]/sessionstore-backups contained session records from months ago, one was 4.2MB
  • ~/.mozilla/firefox/Crash Reports contained 1.5MB of data on old crashes
  • ~/.mozilla/firefox/[profile]/storage-sync-v2.sqlite-wal was 12.2MB and grows pointlessly over time due to this bug, commonly triggered by NoScript

I added this to /opt/.xfiletool.lst:
Code: [Select]
.dbus/session-bus
.mozilla/firefox/Crash Reports
sessionstore-backups

For storage-sync-v2.sqlite-wal, load sqlite3-bin and run this command (based on the one in the bug report) as root to automatically clean it up in all Firefox profiles (I added it in /opt/shutdown.sh):
Code: [Select]
for db in /home/*/.mozilla/firefox/*/storage-sync-v2.sqlite; do sqlite3 "$db" .tables; done

The "-wal" files then get automatically deleted by sqlite3.
« Last Edit: July 24, 2025, 09:16:00 PM by CNK »

Offline CNK

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 384
Re: Some filetool.sh backup excludes
« Reply #1 on: July 29, 2025, 11:30:25 PM »
For storage-sync-v2.sqlite-wal, load sqlite3-bin and run this command (based on the one in the bug report) as root to automatically clean it up in all Firefox profiles (I added it in /opt/shutdown.sh):

Ah but /opt/shutdown.sh runs after the backup so that didn't work and storage-sync-v2.sqlite-wal is back to 1.7MB already! I remembered I've set up my own script calling backup before power-off and added the command to clear it in there instead.