Archive all directories in /path/to/directory/* (only command line arguments, no sub-directories) to files with .tar.gz extension
find /path/to/directory/* -maxdepth 0 -type d -printf "%P\n" -exec sudo tar -zcpvf {}.tar.gz {} \;