Reply To: RE: Shell script to rsync backup files to a remote server

VitalPBX Community Support General Discussion Shell script to rsync backup files to a remote server Reply To: RE: Shell script to rsync backup files to a remote server

    Up
    0
    Down

    You may use the SCP command, first, you may create a shell script named “backup.sh”  under “/var/lib/ombutel/scripts” with the following content

    #!/bin/bash
    set -e

    scp -r /var/lib/ombutel/static/backups/c4cablahblahblah remote_username@10.10.0.2:/remote/directory

    After create the script you must give it execution permissions:

    chmod +x backup.sh

    Now, go to “/etc/cron.d” and create a file named “external-backup” with the following content:

    0 0 * * 0 root /var/lib/ombutel/scripts/backup.sh

    Save the file and restart the crond service

    systemctl restart crond.service

    With all these steps you will be able to copy backups to an external server every day at midnight

    0