Here’s the one-liner for backing up a directory, named as the directory name plus the date and time when the backup is done.

tar czf ~/backups/dir-backup-$(date +'%Y%m%d_%H%M%S').tar.gz ~/dir/*