- Open terminal
- Drop the folder where you want to keep the script in the terminal window
- Type "touch backup_script" and hit enter
Now, every time you want to run a backup, open your terminal and drop the script into the window and hit enter.
nb// the folder locations are hardcoded and it's not automatic (run it manually each day)
#!/bin/bash
echo Hey Will, copying your files now...
TIME=`date +%b-%d-%y`
FILENAME=backup-$TIME.tar.gz
SRCDIR=~/Google\ Drive/PwC
DESDIR=~/Documents/backups
tar -cpzf $DESDIR/$FILENAME "$SRCDIR"
echo Hey Will, all done...