16 lines
417 B
Bash
16 lines
417 B
Bash
#!/bin/bash
|
|
|
|
. bin/setup_ssh_keys.sh
|
|
|
|
install_pkg cron
|
|
|
|
cp ./assets/backup.sh ~/backup.sh
|
|
chmod +x ~/backup.sh
|
|
|
|
sed -i "s/^receiving_ip=.*/receiving_ip=$RECEIVING_IP/" ~/backup.sh
|
|
sed -i "s/^receiving_user=.*/receiving_user=$RECEIVING_USER/" ~/backup.sh
|
|
sed -i "s/^receiving_port=.*/receiving_port=$RECEIVING_PORT/" ~/backup.sh
|
|
|
|
cronjob="0 2 * * * ~/backup.sh"
|
|
|
|
( crontab -l 2>/dev/null; echo "$cronjob" ) | crontab - |