I've used the following script to do this:
#!/bin/bash
set -ex
gitFolder=/Users/piousbox/projects/home-config-mac
backupFolder=$gitFolder/home/piousbox/backup-lite
mkdir -p $backupFolder
# cat "/Users/$USER/Library/Application Support/Google/Chrome/Default/Bookmarks.bak" | jq . > $gitFolder/$date\ chrome-bookmarks.json
cp "/Users/$USER/Library/Application Support/Google/Chrome/Default/Bookmarks.bak" "$backupFolder/chrome-bookmarks.json"
cd $gitFolder
git add home/piousbox/backup-lite
git commit -m "backup chrome bookmarks"
git push
set +ex
echo 'ok'
Please login or register to post a comment.