Created
November 27, 2013 09:16
-
-
Save smichaelsen/7672872 to your computer and use it in GitHub Desktop.
tmux script to start (or re-attach) a backup session. The session launches a custom backup script and Time Machine.
This file contains hidden or 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
| if [ `tmux ls | grep -c backup` -gt 0 ]; then | |
| echo "Session found. Attaching.." | |
| else | |
| echo "Session not found. Creating.." | |
| tmux new-session -s backup -n bilder -d | |
| echo "Building window#1 (bilder)" | |
| tmux split-window -v -t backup:1 | |
| tmux send-keys -t backup:1.1 '~/backup_bilder' C-m | |
| tmux send-keys -t backup:1.2 'tmutil startbackup' C-m | |
| fi | |
| tmux attach -t backup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment