File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ BACKUP_FOLDER=" $HOME /Dropbox/Backups/Application Support"
4+ APPLICATIONS=(
5+ " Farrago"
6+ " Fission"
7+ " Loopback"
8+ " Audio Hijack"
9+ " Flux"
10+ " com.operasoftware.Opera"
11+ " com.tinyapp.TablePlus"
12+ " obs-studio"
13+ )
14+
15+ datestamp=$( date +%Y-%m-%d)
16+ directory=" ${BACKUP_FOLDER} /${datestamp} "
17+
18+ test -d " $directory " || mkdir -p " $directory "
19+
20+ cd " $HOME /Library/Application Support"
21+
22+ for application in " ${APPLICATIONS[@]} " ; do
23+ echo " Archiving settings of ${application} to ${directory} "
24+ tar cjf " ${directory} /${application} .tar.bz2" " $application "
25+ done
26+
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ BACKUP_FOLDER=" $HOME /Dropbox/Backups/Application Support"
4+ last=$( ls " $BACKUP_FOLDER " | sort | tail -n1)
5+ datestamp=" ${1:- $last } "
6+ source_directory=" ${BACKUP_FOLDER} /${datestamp} "
7+
8+ cd " $HOME /Library/Application Support"
9+
10+ echo " Restoring '~/Library/Application Support' from $source_directory "
11+
12+ IFS=$' \n '
13+ for app in $( find " $source_directory " -name " *tar.bz2" ) ; do
14+ target=" $( basename -s .tar.bz2 " $app " ) "
15+ echo " $target "
16+ test -d " $target " \
17+ && mv " $target " " ${target} __old_$( date +%s) "
18+ tar xjf " $app "
19+ done
20+
You can’t perform that action at this time.
0 commit comments