Iam trying to build a script to monitor any modifications in files in my FTP site. The script is given below. I have used wc -l
to count the no. of files in the directory and have defined the constant value of files if there is going to be any modification in files like if my co-worker updates in my FTP this will send me a notification. Am trying to cron this to achieve. But the script actually just hangs after the count . It doesn't provide me the expected result. Is there anything that am wrong with the code. Am just a beginner in Bash could anyone help me solve this
#!/usr/bin/bash
curl ftp://Sterst:abh89TbuOc@############################/Test/| wc -l ;
read b;
a=9
if [ "$b" != "$a" ];
then
echo "FTP dir has modified mail" -s "dir notification" sni912@######.com;
fi