Below is my code and I am able to get the ssh connection. But after that it is doing nothing.
log_time="date +%F\%T"
PR_ONE="username@hostname"
file="/home/log.txt"
to_list="myemail"
echo "`$log_time`" >> $file
`ssh $PR_ONE "echo df -hP | grep fs1 | awk '{print $4}'"` >> $file
cat $file | mailx -s "Disk space usages" $to_list
I am getting the email but only with $log_time
. I know that I am doing something wrong in quotations in the ssh
line.
I am new to shell scripting.