Created
          March 29, 2015 12:05 
        
      - 
      
 - 
        
Save videogramme/02f64c4fa4e4208e9449 to your computer and use it in GitHub Desktop.  
Revisions
- 
        
videogramme created this gist
Mar 29, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ ### https://linuxfr.org/forums/general-cherche-logiciel/posts/resolu-backup-oui-c-est-une-vielle-problematique ### #!/bin/sh date=`date "+%Y%m%d-T%H%M%S"` # Attention au / SOURCE_DIR=/home/denis/ TARGET_HOST=192.168.0.4 TARGET_USER=rsync TARGET_DIR=/volume1/persosave/rsync/denis time rsync --archive --one-file-system --hard-links \ --human-readable --inplace \ --partial --progress \ --delete-excluded \ --exclude-from=$SOURCE_DIR/script/rsync-exclude \ --link-dest=$TARGET_DIR/current \ $SOURCE_DIR $TARGET_USER@$TARGET_HOST:$TARGET_DIR/incomplete_back-$date if [ $? -eq 0 ]; then ssh $TARGET_USER@$TARGET_HOST "mv $TARGET_DIR/incomplete_back-$date $TARGET_DIR/back-$date \ && rm -f $TARGET_DIR/current \ && ln -s back-$date $TARGET_DIR/current"; fi