Created
May 6, 2018 01:57
-
-
Save mathcass/2f82b59f0bf22e0050937a000e82cc9b to your computer and use it in GitHub Desktop.
Simple BASH script to backup Mozilla bookmarks to script location directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# The intent here is to copy a daily backup of Mozilla bookmarks. Because the | |
# SQLITE database file can be as large as 25+ megabytes, if it has been backed up | |
# within the last day, there's no need to copy it over again. | |
# If there is a copy of the database already, bail. Otherwise, copy it. | |
MOZILLA_DIR="$HOME/.mozilla" | |
DIR=$(dirname $0) | |
BOOKMARK_PATH="$DIR" | |
TOTAL_FILES=$(find $DIR -maxdepth 1 -type f -mtime -1 -iname "places*.sqlite"| wc -l) | |
if [ $TOTAL_FILES -eq 0 ]; then | |
# echo "Would copy file" | |
cp $(find $MOZILLA_DIR -iname "places.sqlite") $DIR/places_$(date +%Y-%m-%d_%H-%M-%S).sqlite | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment