Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Backups

zip every directory in the current dir

for d in */; do zip -r "${d%/}.zip" "$d" && rm -r "$d"; done

unzip every directory in the current dir

 .............

Simple daily zip script

#!/bin/bash
DATE=`date +%d`
DIR=/Users/aike/Dropbox/Backups
cd /Users/aike/code/ && for i in */; do
  zip -r "$DIR/$DATE.${i%/}.zip" "$i";
done

Table of contents