#!/bin/sh #################################### # # Backup minecraft world to a # specified folder. # #################################### day_raw=$(date +%A) case $day_raw in Sunday) day="Dimanche";; Monday) day="Lundi";; Tuesday) day="Mardi";; Wednesday) day="Mercredi";; Thursday) day="Jeudi";; Friday) day="Vendredi";; Saturday) day="Samedi";; *) ;; esac archive_file="$day-Minecraft" echo $archive_file.tar.gz cd /tmp tar -I pigz -cvf /tmp/$archive_file.tar.gz /home/dexter/minecraft/ md5sum $archive_file.tar.gz > $archive_file.md5 sudo mount -t cifs //mafreebox.freebox.fr/Disque\ dur/ /media/nas/ -o user=freebox,password=password,uid=1000,gid=1000,rw,vers=1.0 sudo cp /tmp/$archive_file.tar.gz /media/nas/mc_backup sudo cp /tmp/$archive_file.md5 /media/nas/mc_backup sleep 6 sudo umount /media/nas ncftpput -R -v -u "wareck" -p "zorn69" ftpperso.free.fr minecraft_bkp/ /tmp/$archive_file.tar.gz sleep 5 ncftpput -R -v -u "wareck" -p "zorn69" ftpperso.free.fr minecraft_bkp/ /tmp/$archive_file.md5 sleep 5 sudo rm /tmp/$archive_file.tar.gz sudo rm /tmp/$archive_file.md5 echo `date` "Backup done" >>/var/log/mc_backup/log