Created
July 24, 2016 22:44
-
-
Save zackn9ne/22f3114f87d89bf2a9d5eb390aae71bb to your computer and use it in GitHub Desktop.
~/Pictures rsync shellscript
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
| #!/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