Skip to content

Instantly share code, notes, and snippets.

@Brainiarc7
Forked from oguya/parallel_sync.sh
Created July 9, 2014 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Brainiarc7/a7df18ce28d7c485b618 to your computer and use it in GitHub Desktop.
Save Brainiarc7/a7df18ce28d7c485b618 to your computer and use it in GitHub Desktop.
#!/bin/bash
#backup studio project files
#ignore build/ dir
SRC_DIR="/home/james/AndroidStudioProjects/"
DEST_DIR="/run/media/james/tank/Backups/studio/"
cd $SRC_DIR
#step 1::copy dirs struct
rsync -v -d $SRC_DIR $DEST_DIR
PROJS_LIST=`find . -mindepth 1 -maxdepth 1 -print`
wait
#step 2::backup each project dir
parallel -j200% --max-procs 20 --joblog /tmp/par_logs 'rsync -aAXvz --progress --human-readable --delete --exclude=*build/ {} $DEST_DIR{.}' ::: $PROJS_LIST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment