File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed
Expand file tree Collapse file tree 2 files changed +42
-0
lines changed 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+
7+ cd " $HOME /Library/Application Support"
8+ IFS=$' \n '
9+ for app in $( find " ${BACKUP_FOLDER} /${datestamp} " -name " *tar.bz2" ) ; do
10+ target=" $( basename -s .tar.bz2 " $app " ) "
11+ echo " $target "
12+ test -d " $target " \
13+ && echo mv " $target " " ${target} __old_$( date +%s) "
14+ echo tar xjf " $app "
15+ done
16+
You can’t perform that action at this time.
0 commit comments