Files
r_backup/bin/oldies/recup_topisto_backups.sh
2018-09-08 19:01:15 +02:00

36 lines
835 B
Bash
Executable File

#!/bin/bash
ladate=`date +%Y%m%d`
targetdir=/opt/topisto.net
rootdir=/tmp/download_topisto
backdir=$rootdir/$ladate
param=`echo TTNsY2gxczNkM2sK | base64 -d`
salt=`date +%Y%m%d%H`
cmd="wget --quiet --user backup --password $param"
if [ ! -d $targetdir ]
then
mkdir -p $targetdir
fi
if [ ! -d $backdir ]
then
rm -rf $rootdir/*
rm -rf $targetdir/*
mkdir -p $backdir
for fichier in www.tar.bz2 TOPISTO_apps.tar.bz2
do
code=`echo -n /opt/backup/$fichier$salt | md5sum | awk '{ print $1 }' `
echo Récupération de $fichier dans $backdir/$fichier via $code
$cmd -O $backdir/$fichier https://www.topisto.net/backup/download.php?file=$code
cd $targetdir
echo Extraction de $backdir/$fichier dans $targetdir
tar xfj $backdir/$fichier
done
else
echo "ALREADY DONE : Downloads from topisto.net"
fi