Archive all directories in /path/to/directory/* (only command line arguments, no sub-directories) to files with .tar.gz extension transforming the full paths to relative paths
find /path/* -maxdepth 0 -type d -exec sudo tar -zcpvf {}.tar.gz {} \;