Diferències
Ací es mostren les diferències entre la revisió seleccionada i la versió actual de la pàgina.
| Següent revisió | Revisió prèvia | ||
| linux:scripts:rsync [27/09/2011 10:19] – creado mate | linux:scripts:rsync [15/11/2011 01:59] (actual) – edició externa 127.0.0.1 | ||
|---|---|---|---|
| Línia 1: | Línia 1: | ||
| = rsync.sh | = rsync.sh | ||
| - | < | + | < |
| #!/bin/bash | #!/bin/bash | ||
| # | # | ||
| Línia 27: | Línia 27: | ||
| mail -s "RSYNC $TITLE finished" | mail -s "RSYNC $TITLE finished" | ||
| rm $DATE-$TITLE.tmp | rm $DATE-$TITLE.tmp | ||
| + | </ | ||
| + | <code bash> | ||
| + | #!/bin/bash | ||
| + | |||
| + | # | ||
| + | # -a = rlptgoD | ||
| + | # -r = recursive | ||
| + | # -l = copia symlinks como symlinks | ||
| + | # -p = copia los permisos | ||
| + | # -t = conserva fecha de modificación | ||
| + | # -g = conserva el grupo del fichero | ||
| + | # -o = conserva el usuario del fichero | ||
| + | # -D = ficheros especiales (?) | ||
| + | # -v = verbose | ||
| + | # -b = backup | ||
| + | # -h = human readable (nums) | ||
| + | # --delete = borra ficheros en destino no existentes en origen | ||
| + | # -u = update | ||
| + | # --ignore-errors = continua copiando aunque haya errores I/O | ||
| + | # --delete-excluded = borra los ficheros de destino aunque estén en directorios de exclusión | ||
| + | # --force = elimina directorios en destino aunque tenga ficheros | ||
| + | # --exclude-from = indica fichero con PATTERNs de exclusión. Cualquier fichero/ | ||
| + | |||
| + | # APP | ||
| + | export DISPLAY=: | ||
| + | NOW=$(date +" | ||
| + | i=$(date +" | ||
| + | FILE=" | ||
| + | |||
| + | notify-send -u normal --icon=gtk-refresh --category=transfer " | ||
| + | |||
| + | #tar -g / | ||
| + | rsync -au --ignore-errors --stats --delete --delete-excluded --force --exclude-from " | ||
| + | |||
| + | RETVAL=$? | ||
| + | |||
| + | if [ $RETVAL -ne 0 ]; then | ||
| + | notify-send -u critical --icon=gtk-dialog-error --category=transfer.error | ||
| + | else | ||
| + | notify-send -u normal --icon=gtk-apply --category=transfer.complete " | ||
| + | fi | ||
| + | </ | ||
| + | <code bash exclude> | ||
| + | .gvfs | ||
| + | .cache | ||
| + | .thumbnails | ||
| + | *.nobackup | ||
| + | jdownloader | ||
| + | \[NB\]* | ||
| </ | </ | ||