r/ScriptSwap • • Mar 13 '17
[Bash] Firefox bookmarks backup
Firefox creates daily backups of bookmarks, this script copies them to your chosen folder. it will work for multiple profiles.
#!/bin/bash
# Choose backup folder
backup_dest="$HOME/Documents/bookmarkbackups"
# Copy bookmarkbackups, which Firefox creates automatically
rsync -am --include "*/" --include "bookmarkbackups/*" --exclude "*" \
"$HOME/.mozilla/firefox/" "$backup_dest"
Edit: I know find needs xargs instead of exec, for issues with spaces in file names, but I'm not familiar enough with the find command to alter it, so the following section should be removed or changed so it isn't a risk.
# Delete backup bookmarks files older than 30 days
#find "$backup_dest" -type f -mtime +5 -exec rm -rf {} \;
3
Upvotes
View all comments
Show parent comment
1
u/[deleted] Mar 13 '17
maybe they can instead be moved to trash? i'm not familiar with the find command to mess with it.
"$HOME/.local/share/Trash/files/"