Back up your Web program
#!/bin/bash/bin/tar czf/mnt/backup_website/web_$ (date +%y%m%d_%h%m%s). Gz. tar /mnt/wwwroot/web/mnt/backup_websitefind . -mtime +1"*20[1-9][3-9]*"xargsrm - 0
Backing Up the database
#!/bin/Bash/bin/Tarczf/mnt/backup_website/newjiagu_$ (Date+%y%m%d_%h%m%s). Gz.Tar/mnt/wwwroot/NEWJIAGUCD/mnt/Backup_websiteFind. -mtime +1-name"*20[1-9][3-9]*"|Xargs RM-Fexit0[email protected] shell]#CatBackup_database.SH #!/bin/Bashmysqldump-uroot-proot Web >/home/database/web_$ (Date+%y%m%d_%h%m%S). SQLCD/home/DatabaseFind. -mtime +7-name"*20[1-9][3-9]*"|Xargs RM-Fexit0
Cutting logs
#!/bin/Bashlogs_path=/home/Wwwlogsyesterday=$(Date-D"Yesterday"+%y%m%d)MV${logs_path}/access.log ${logs_path}/${yesterday}.logKill-USR1 'PSAxu |grep "Nginx:master Process"|grep-Vgrep|awk '{print $}'' CD ${logs_path}Find. -mtime +7-name"*20[1-9][3-9]*"|Xargs RM-Fexit0
Common Shell (Backup database, backup site, cut access log)