Last active
August 10, 2021 13:15
-
-
Save honghuac/72da9e31e4bdbfe5d1c40012db6c43dd to your computer and use it in GitHub Desktop.
Hong's log file copy script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make it executable with chmod +x backup.sh | |
#!/bin/bash | |
/usr/bin/scp -r -P {REMOTEPORT} user@serveripaddress:/home/remoteuser/directory /home/localuser/directory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Additional instructions for using this script
How to edit Crontab and execute this script as a cronjob:
0 0 * * * /path/to/logcopy.sh > /var/log/logcopy.log 2>&1
Setup passwordless login using these instructions:
https://linuxize.com/post/how-to-setup-passwordless-ssh-login/