
#DATETIMESTAMP=$(date +"%y%m%d%H%M")
DATETIMESTAMP=$(date +"%y%m%d")

echo $DATETIMESTAMP

FOLDERNAME=alouette

ZIPNAME=$FOLDERNAME-$DATETIMESTAMP.zip
DEST1=/run/media/roland/CHASTAIN-1/sauvegardes/
DEST2=/home/roland/Documents/site/public_html/roland/sauvegardes/

pushd ..

zip -r $ZIPNAME $FOLDERNAME -x $FOLDERNAME/git/\.git/\*

if [ -d $DEST1 ]; then
  cp -fv $ZIPNAME $DEST1
else
  echo "[WARNING] Cannot find directory $DEST1"
fi

mv -fv $ZIPNAME $DEST2
echo $DEST2$ZIPNAME > file.txt && uploader file.txt

popd

exit 0

pushd ..
zip -r $FOLDERNAME-$DATETIMESTAMP.zip $FOLDERNAME -x $FOLDERNAME/\.git/\* -x $FOLDERNAME/\*\.sh
cp -fv $FOLDERNAME-$DATETIMESTAMP.zip /run/media/roland/CHASTAIN-1/sauvegardes/
mv -fv $FOLDERNAME-$DATETIMESTAMP.zip $HOME/Documents/site/public_html/roland/echecs-aleatoires-fischer/sources.zip
popd
