Created
May 29, 2015 07:07
-
-
Save tklee1975/34d038ae2db511d650fc to your computer and use it in GitHub Desktop.
A simple script to test scp working correct by Cronjob
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
#!/bin/sh | |
TIME_FILE=/etc/temp/datetime.txt | |
USER=admin | |
REMOTE_SERVER=192.168.0.1 | |
REMOTE_PORT=22 | |
REMOTE_PATH=/home/admin/temp | |
# Make a file and then send to Lab server | |
date > $TIME_FILE | |
scp $TIME_FILE $USER@$REMOTE_SERVER:$REMOTE_PATH -p $REMOTE_PORT | |
echo $TIME_FILE |
Why you may use this testing script:
- You want to create a backup process from one server to another
- You want to make sure the "auto ssh login" working when it is called by cronjob
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to test: