- Create archive of all files under public_html directory ignoring all files and folders including text backup in there named
1# zip -r public_html.zip public_html -x *backup* - Create archive of all files under httpdocs directory ignoring .svn or .git files and directories.
1# zip -r httpdocs.zip httpdocs --exclude *.svn* --exclude *.git* - Create archive of all files under httpdocs directory ignoring all files and directories ending with with .log.
1# zip -r httpdocs.zip httpdocs --exclude "*.log" - Exclude .git file and node_modules directory
1$ zip -r [target_file] [source_file] -x *.git* node_modules/\* - Exclude .git file and files in node_modules directory, but keep node_modules directory
1$ zip -r [target_file] [source_file] -x *.git* node_modules/**\*
- Exclude cache, backups, uploads directory, but keep node_modules directory (Current date for the generated file)
1$ sudo zip -r /var/www/backup/backup$(date +"%Y-%m-%d").zip /var/www/html -x "*cache*" -x "*backups*" -x "*uploads*"