2 useful scripts - backup Firefox bookmarks, clean SpiderOak

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
BlackVeils

2 useful scripts - backup Firefox bookmarks, clean SpiderOak

Post by BlackVeils »

backup Firefox bookmarks

Code: Select all

#!/bin/bash

# repeat this cycle every 30 minutes
# although firefox only creates a file once a day
while true; do

        # copy bookmarkbackups folder from firefox profile
        # it will backup from every profile
        # to /home/vicky/Documents/bookmarkbackups firefox
	rsync -amv --include "*/" --include "bookmarkbackups/*" --exclude "*" '/home/vicky/.mozilla/firefox/' '/home/vicky/Documents/bookmarkbackups firefox/'


	# delete backup files older than 30 days
	find '/home/vicky/Documents/bookmarkbackups firefox/' -type f -mtime +30 -exec rm -rf {} \;

sleep 30m; done
i added this as a startup program. my documents folder is constantly synced to spideroak online storage, but you may want to direct the backup to dropbox for example. replace vicky with your username.


clean SpiderOak

Code: Select all

#!/bin/bash

# notification feedback that it is starting the process
notify-send "  Deleting SpiderOak history...  " -t 6000

# closes spideroak for you
killall SpiderOak
sleep 5

# clears all historical versions of files
# man spideroak for historical versions alternative options
/usr/bin/SpiderOak --purge-historical-versions all

# empty the garbage bin in your spideroak account
# of files you deleted on the computer, but spideroak keeps
/usr/bin/SpiderOak --empty-garbage-bin

# open spideroak
nohup /usr/bin/SpiderOak &
sleep 5

# notification feedback that it has completed the task
notify-send "  History cleared  " -t 6000

sleep 5
exit 0
i created a menu launcher for this item.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Locked

Return to “Scripts & Bash”