You will need to install smbclient or ftp-client and mailutils (optional, for sending unsuccessful report if you have mailserver)
sudo apt update && sudo apt install mailutils ftp
or if you need to use SMB
sudo apt update && sudo apt install mailutils smbclient
-
Put backup.sh and backup.conf to
/root
-
Open backup.conf on text-editor and using tips set the necessary settings.
-
If you need to use ftp-client put .netrc to
/root
and set correct permissionssudo chown root:root /root/.netrc && sudo chmod 600 /root/.netrc
-
Open .netrc in text-editor and set correct authentication data
-
Set correct permission to the script
sudo chmod +x /root/backup.sh
- Add cron-task to root-crontab.
sudo echo "0 2 * * * root /root/backup.sh 2>/dev/null" >> /etc/crontab