Skip to content
Snippets Groups Projects
Select Git revision
  • 287fe8bd2b89e9fd3005828a5e4fccb8c648b4f5
  • main default
  • 35-cgu
  • 34-peertube-support
  • 27-add-autoplay-to-iframe
  • 33-bug-on-youtube-embed-urls
  • RC-Rekall-v1.1-fix_lpo
  • tuleap-140-go-back-to-my-capsules-page-when-i-m-on-capsule-preview-page
  • RC-Rekall-v1.2-fix10
  • RC-Rekall-v1.2-fix9
  • RC-Rekall-v1.2-fix8
  • RC-Rekall-v1.2-fix7
  • RC-Rekall-v1.2-fix6
  • RC-Rekall-v1.2-fix5
  • RC-Rekall-v1.2-fix4
  • RC-Rekall-v1.2-fix3
  • RC-Rekall-v1.2-fix2
  • RC-Rekall-v1.2-fix1
  • RC-Rekall-v1.1-fix-3
  • RC-Rekall-v1.1-fix-2
  • RC-Rekall-v1.1-fix-1
  • RC-Rekall-v1.1-delivered
  • preprod20220209-1535
23 results

webpack.config.js

Blame
  • backup.sh 1.78 KiB
    #!/bin/bash
    
    DIR=$(realpath $(dirname $0))
    if [ ! -z "$1" ]; then
       conf_file=$1
       shift
    fi
    source $DIR/inc.sh
    
    exit_on_fail(){
            [ $1 -ne 0 ] && leave $@
            echo "Done"
    }
    
    retrie_on_fail(){
            cat <<EOF | lftp $host
    user $user $ftppass
    
    rm -rf $remotedir
    mkdir $remotedir
    EOF
    backup "cleaned"
    leave $?
    }
    
    backup(){
    
            retries=$1
            shift
            export PASSPHRASE="$encpass"
            export FTP_PASSWORD="$ftppass"
            #set -x
    
            echo "Removing old backups"
            /usr/bin/duplicity remove-older-than $BK_FULL_LIFE \
                    --force ftp://$user@$host/$remotedir/
            /usr/bin/duplicity remove-all-inc-of-but-n-full $BK_KEEP_FULL \
                    --force ftp://$user@$host/$remotedir/
            /usr/bin/duplicity remove-all-but-n-full $BK_KEEP_FULL \
                    --force ftp://$user@$host/$remotedir/
    
            echo "Running pre_actions"
            pre_actions
            echo "Creating encrypted incremental backup: $bckplist "
            /usr/bin/duplicity \
                    --full-if-older-than $BK_FULL_FREQ \
                    --include ${bckplist// / --include } \
                    --exclude '**' \
                    / ftp://$user@$host/$remotedir/
            ret=$?
            if [ -z "$retries" ]
            then
                    retrie_on_fail $ret "Duplicity failed"
            else
                    exit_on_fail $ret "Duplicity failed"
            fi
    
            echo "Backup completed"
    
            echo "Cleaning"
            /usr/bin/duplicity cleanup --force --extra-clean ftp://$user@$host/$remotedir/
            echo "Removing backup cache"
            rm -rf /root/.cache/duplicity/
            echo "Backups state"
            /usr/bin/duplicity collection-status ftp://$user@$host/$remotedir/
            #set +x
            unset PASSPHRASE
            unset FTP_PASSWORD
            echo "All Done"
    }
    backup
    leave $?