Advertisement
Guest User

Untitled

a guest
Jun 1st, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #Backup database for mediacenter_webservice
  2. mysqldump --user=<your_username> --password="<your_password>" <your_database> | gzip > <your_serverpath>/$(date +%F)_<your_filename>.sql.gz
  3.  
  4. #Delete archives older than 210 days
  5. find <your_serverpath> -type f -mtime +210 -exec rm {} +
  6.  
  7. #Delete zip (downloads) older than 10 days
  8. find <your_serverpath>/*.zip -mtime +10 -exec rm {} \;
  9.  
  10. #Delete tmp files older than 10 days
  11. find <your_serverpath>/*.* -mtime +10 -exec rm {} \;
  12.  
  13. #chmod folder and files
  14. find <your_serverpath> -type d -exec chmod 755 {} \;
  15. find <your_serverpath> -type f -exec chmod 644 {} \;
  16.  
  17. #Antivirus in server
  18. /malware.py --minscore 10 > log.txt
  19. clamscan -r --infected log.txt
  20.  
  21. #Compress and uncompress files
  22. tar -cvzf backup.tar.gz *
  23. tar -xvf backup.tar.gz
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement