PROJET AUTOBLOG


Shaarli - Mitsu'liens

Site original : Shaarli - Mitsu'liens

⇐ retour index

HubiC, HubicFuse, Duplicity et rsync

vendredi 28 mars 2014 à 21:22
Mes petits scripts, adaptations d'existants :)

→→  hubicfuse
#!/bin/bash
echo "Mounting..."
hubicfuse "/media/hubic" -o username='blablabla',password='blablabla',client_id='api_hubic_blablabla',client_secret='blablabla',redirect_uri='https://localhost/',noauto_cache,sync_read
if [ $? = 0 ]; then
read -p " Press Enter to unmount "
else
read -p " Erreur..."
fi
fusermount -u "/media/hubic"
echo "ok"

→→  hubicduplicity
#!/bin/bash

locker='/home/user/Bureau/duplicity_en_cours.lock'
forcefull='/home/user/Bureau/duplicity-full'
sourcefolder='/home/user/'
destfolder='file:///media/duplicity-home/'

if [ -f $locker ]
then exit
else
touch "$locker"

PASSPHRASE="blablabla"
FULLIFOLDERTHAN="1D"
RETENTION="2M"
LOGERROR="/tmp/duplicity-hubic-error.log"
LOGREPORT="/tmp/duplicity-hubic-status.log"
exec 2> ${LOGERROR}
export PASSPHRASE


# Backup  (full si forcé, sinon inc)
if [ -f $forcefull ] ; then
duplicity --full-if-older-than ${FULLIFOLDERTHAN} $sourcefolder $destfolder
else
duplicity $sourcefolder $destfolder
fi

# Suppression des vieux backups
duplicity remove-older-than ${RETENTION} $destfolder --force

# Rapport sur le backup
duplicity collection-status $destfolder >> ${LOGREPORT}


rm "$locker"
fi

→→ hubicrsync
#!/bin/bash
rsync -rvh --progress --size-only --no-inc-recursive --delete-before "/media/duplicity-home/" "/media/hubic/default/home/"
echo "ok"


→→→ on vérifie et on termine hubicfuse  :)
(Permalink)