Created
March 6, 2023 00:12
-
-
Save incanus/1aa2f7832b67d3e5e34121aaa42fca62 to your computer and use it in GitHub Desktop.
backup job I run on an hourly cron for some Safari safety
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/sh | |
SRC1=$HOME/Library/Safari | |
SRC2=$HOME/Library/Containers/com.apple.Safari/Data/Library/Safari | |
HOST=$( hostname | sed 's/\..*//' ) | |
HOUR=$( date +"%H" ) | |
DST=$HOME/Sync/Safari/$HOST/$HOUR | |
mkdir -p $DST 2>/dev/null | |
cd $SRC1 | |
cp \ | |
Bookmarks.plist \ | |
CloudTabs.db \ | |
History.db \ | |
LastSession.plist \ | |
RecentlyClosedTabs.plist \ | |
$DST 2>/dev/null | |
cd $SRC2 | |
cp \ | |
SafariTabs.db \ | |
$DST |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment