mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

commit ce7f0a3a376f3fff0d8899410ce3f1c99ae388ff
parent 2b8d12ca5754fb34b4caf92025112e74aad10cd2
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Sat, 17 Dec 2016 13:51:04 +0100

Merge branch 'master' of a3nm.net:git/mybin

Diffstat:
updir | 11+++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/updir b/updir @@ -3,9 +3,7 @@ # copy all contents of $1 on $2 # giving unique name to directories # and put stuff in cache - -# hardcoded list of exclusions -EXCLUDE='--exclude="papers/**" --exclude="wikipedia/**"' +# with hardcoded list of exclusions set -x set -e @@ -17,13 +15,14 @@ shift cd "$FOLDER" # copy files to destination -rsync -avzPy --progress --backup --exclude="cache/**" --exclude="papers/**" --exclude="wikipedia/**" ./ "$DEST" +rsync -avzPy --progress --backup --exclude="cache/" --exclude="/papers/**" --exclude="wikipedia/**" ./ "$DEST" # move files to cache # TODO: this is inefficient and should be done with mv invocations # use, e.g., http://unix.stackexchange.com/a/155633/8446 -rsync -avzPy --remove-source-files --exclude="cache/**" --exclude="papers/**" --exclude="wikipedia/**" $EXCLUDE ./ "cache/" +rsync -avzPy --remove-source-files --exclude="cache/" --exclude="/papers/**" --exclude="wikipedia/**" $EXCLUDE ./ "cache/" # now, remove remaining empty directories -find ./ -type d -empty -exec rmdir '{}' + +# find ./ -type d -empty -exec rmdir '{}' + +# this doesn't really work, but anyway, the folder structure may still be useful