fmuquartet
Programmer
Greetings!
I have revised a simple script for connecting to a remote server and zipping files and then pulling them to a local server, I now need help implement some logic to send notification if files on the remove machine aren't present.
***INFO***
ERROR when there are no files:
Archiving Metrics files
No match.
Pulling Metrics Archive
Connecting to remote-server...
Couldn't stat remote file: No such file or directory
File "/var/tmp/Activity.zip" not found.
Script:
#!/bin/bash
USERID=foobar
REM_MACHINE=remote-server
REM_FILE=/var/tmp/Eactivity.zip
LOC_FILE=/home/user/upload
ZIP=/usr/ecc/exec/utils/zip
FILE=/var/tmp/Eactivity
#######################################
#Package remote File #
#######################################
echo -e "\nArchiving Metrics files\n"
ssh $REM_MACHINE $ZIP -9r $FILE /tmp/reporting/activity*.open
#######################################
#Pulling Remote file
#in user upload directory #
#######################################
echo -e "\nPulling Metrics Archive\n"
sftp $USERID@$REM_MACHINE:$REM_FILE $LOC_FILE
echo -n
Thanks!
I have revised a simple script for connecting to a remote server and zipping files and then pulling them to a local server, I now need help implement some logic to send notification if files on the remove machine aren't present.
***INFO***
ERROR when there are no files:
Archiving Metrics files
No match.
Pulling Metrics Archive
Connecting to remote-server...
Couldn't stat remote file: No such file or directory
File "/var/tmp/Activity.zip" not found.
Script:
#!/bin/bash
USERID=foobar
REM_MACHINE=remote-server
REM_FILE=/var/tmp/Eactivity.zip
LOC_FILE=/home/user/upload
ZIP=/usr/ecc/exec/utils/zip
FILE=/var/tmp/Eactivity
#######################################
#Package remote File #
#######################################
echo -e "\nArchiving Metrics files\n"
ssh $REM_MACHINE $ZIP -9r $FILE /tmp/reporting/activity*.open
#######################################
#Pulling Remote file
#in user upload directory #
#######################################
echo -e "\nPulling Metrics Archive\n"
sftp $USERID@$REM_MACHINE:$REM_FILE $LOC_FILE
echo -n
Thanks!