Created
December 11, 2012 11:12
-
-
Save mrmamba/4257843 to your computer and use it in GitHub Desktop.
Archivado Drobpx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
retencion=31 | |
fecha=`date +"%m%d%y"` | |
cd /root/Dropbox | |
/bin/tar cjf web.tar.bz2 web/ | |
mv web.tar.bz2 archive/$fecha.bz2 | |
find /root/Dropbox/archive/*.bz2 -mtime +$retencion -exec rm {} \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#variables | |
fecha=`date +"%m%d%y"` | |
retencion=30 | |
directorioTrabajo=/root/Dropbox/sql | |
#volcado bbdd | |
cd $directorioTrabajo | |
/usr/bin/mysqldump --user USUARIO--password=CLAVE basededatos > $directorioTrabajo/$fecha.sql | |
#compresion fichero | |
/bin/bzip2 $fecha.sql | |
#limpieza ficheros viejos | |
find $directorioTrabajo/*.bz2 -mtime +$retencion -exec rm {} \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
/usr/bin/rsync -azv --delete /var/www/WEB/ /root/Dropbox/web/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
awesome!