Laman

Counting files and remote server

0   komentar

#!/usr/bin/expect

spawn ssh sduser@172.0.0.2
expect "123"
send "123"
interact
destPath='/archive/Input/ERICIN/AIR/EMG'
dayStamp=`(date --date='1 day ago' '+%Y%m%d')`
if [ -d $destPath ]
then
     cd $destPath
     `cat 'emg_audit_1_'$dayStamp.csv|grep 'ACTPSO_NE_'$dayStamp|wc -l > /home/stsuser/eastregioncount/NEremote$dayStamp.txt`
else
        echo "ERROR: Path $destPath Does not Exists."
fi