Skip to content

Instantly share code, notes, and snippets.

@zackn9ne
Created July 24, 2016 22:44
Show Gist options
  • Select an option

  • Save zackn9ne/22f3114f87d89bf2a9d5eb390aae71bb to your computer and use it in GitHub Desktop.

Select an option

Save zackn9ne/22f3114f87d89bf2a9d5eb390aae71bb to your computer and use it in GitHub Desktop.
~/Pictures rsync shellscript
#!/bin/bash
comboname="photod_$USER"
echo your path will be $comboname
passprt=~/passprt
fullname="$passprt/$comboname"
echo "$fullname"
if [ ! -L "$passprt" ]; then
echo no symlink, making it...
ln -s /Volumes/WD\ My\ Passport\ 259F\ Media ~/passprt
fi
echo symlink exists
mkdir "$fullname"
load="$(ls -R ~/Pictures | wc -l)"
echo getting ready to copy $load files to $passprt
rsync -av --delete ~/Pictures/ "$fullname" | pv -lpes "$load"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment