#!/bin/bash
#############################################
# #
# Little Backup-Script by CarpetSoftware #
# #
#############################################
echo "Copying files to the temporary folder..."
cd /tmp
mkdir backup
mkdir backup/var
mkdir backup/var/www
mkdir backup/root
mkdir backup/home/ts3
mkdir backup/home/share
cp -r /var/www /tmp/backup/var/www
echo "..."
cp -r /root /tmp/backup/root
echo "..."
cp -r /home/ts3 /tmp/backup/home/ts3
echo "..."
cp -r /home/share /tmp/backup/home/share
echo ""
echo "Done!"
echo "Creating archive..."
cd /tmp/backup
tar czfv Backup.tar.gz *
echo "Done!"
echo ""
echo "Uploading files to the backup-server..."
ftp -inv server.srv << EOF
user user passwort
put Backup.tar.gz
bye
EOF
echo "Done!"
echo ""
echo "Cleaning up..."
rm -f Backup.tar.gz
cd /tmp
rm -r backup
cd /root
echo "Done!"
echo ""
echo "Backup done!"
echo "Your files are safe!"