• [^] # Re: Here-document

    Posté par . En réponse au message Amélioration d'un script de bakup (rsync). Évalué à 0.

    Hi,

    Marche po. :-(

    J'ai finalement opté pour la solution avec deux fichiers…

    [root@zoulou /]# cat /etc/backup_OS 
    /dev/*
    /proc/*
    /sys/*
    /tmp/*
    /run/*
    /mnt/*
    /media/*
    /lost+found
    /home/*/.gvfs
    /var/lib/pacman/sync/*
    /opt/*
    /home/bastien/DOCUMENTS
    /home/*/.thumbnails*
    /tmp/*
    /home/*/.mozilla
    /home/*/.thunderbird
    [root@zoulou /]# cat /backup_OS.sh
    #!/bin/sh
    destination=/media/RAID5/BACKUP_OS
    make_exclude_list()
    {
     grep -v '^#' /etc/backup_OS
    }
    EXCLUDE_LIST=`make_exclude_list`
    START=$(date +%s)
    rsync --archive --delete --acls --xattrs --verbose /* $destination --exclude={$EXCLUDE_LIST}
    FINISH=$(date +%s)
    echo "total time: $(( ($FINISH-$START) / 60 )) minutes, $(( ($FINISH-$START) % 60 )) seconds"
    echo "SYNC"
    sync
    rm $destination/Backup\ from\ *
    touch $destination/"Backup from $(date '+%A, %d %B')"
    [root@zoulou /]# ./backup_OS.sh
    sending incremental file list
    rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32)
    rsync: mkdir "/home/*/.thunderbird}" failed: No such file or directory (2)
    rsync error: error in file IO (code 11) at main.c(587) [Receiver=3.0.9]
    rsync: connection unexpectedly closed (9 bytes received so far) [sender]
    rsync error: error in rsync protocol data stream (code 12) at io.c(605) [sender=3.0.9]
    total time: 0 minutes, 0 seconds
    SYNC
    [root@zoulou /]# 
    
    

    Si vous aviez une idée, ça m'arrangerait.

    Merci,
    Bastien