Advertisement
sergio_educacionit

backup.sh

Dec 5th, 2023
682
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.47 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. fecha=$(date +%Y-%m-%d-%S)
  4.  
  5. bdir=/var/backups
  6.  
  7.  
  8.  
  9. # mysql
  10.  
  11. # volcado de base de datos 'wp_database'
  12.  
  13. mysqldump wp_database > $bdir/${fecha}-wp_database.msql
  14.  
  15.  
  16. # Hash
  17. sha256sum $bdir/${fecha}-wp_database.msql > $bdir/${fecha}-wp_database.msql.sha256
  18.  
  19. # firma
  20.  
  21. gpg --detach-sign -u sergio.pernas@educacionit.com.ar -o ${bdir}/${fecha}-wp_database.msql.sign $bdir/${fecha}-wp_database.msql
  22.  
  23.  
  24. # Backup incremental
  25.  
  26. rsync -av /var/backups/ /mnt/
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement