Go for a declaration of the remote service inside .ssh/config file
Generate a public/private ssh key pair, then copy/paste toyr complete (with mail address) key inside : .ssh/authorized_keys
chmod +x backup_script.sh
service_name="cinevoraces"
distant_directory="/home/ubuntu/cinevoraces_infra/backup"
local_directory="/home/rasbpi/cinevoraces-backups"
max_items=100
backup_cinevoraces(){
copy & paste the script content here
}
Don't forget to reload your modified .bashrc
source ~/.bashrc
crontab -e
\
Then add your cronjob line :\
0 4 * * * /bin/bash -c "backup_cinevoraces"