Skip to content

Instantly share code, notes, and snippets.

View jorgeteixe's full-sized avatar

Jorge Teixeira Crespo jorgeteixe

View GitHub Profile
#!/bin/sh
# autor: Álvaro Freire Ares
# autor: Jorge Teixeira Crespo
BACKUP_DIR="/var/backups"
while IFS=':' read -r username _ _ _ _ homedir _; do
if [ -n "$homedir" ] && [ -f "$homedir/.IWantBackup" ]; then
backup_file="${BACKUP_DIR}/$(date +%Y%m%d)_${username}.tar.gz"
if [ ! -f "$backup_file" ]; then