Using bash on OS X 10.10 I'm zipping a folder and saving it elsewhere using this:
_now=$(date +"%Y-%m-%d-%H-%M-%S")
pushd /Users/me/Documents/local-backups/writing
zip -r /Users/me/Documents/local-backups/writing/writing-bak-$_now.zip /Users/me/Dropbox/writing
popd
However my zipped file includes all the annoying directories above "writing" (i.e., from /Users/me/Dropbox/writing).
I saw the question and answer here:
Avoid unwanted path in Zip file
... but I couldn't see how the solution there could apply to my example where directories are far apart.
zip
command? If you change directory to/Users/me/Dropbox/writing
you can simply zip the relative directory.
, or use*
if you don't want the./
prefix.