Hey guys.
I have created a script that mounts an external folder via sshfd, counts the number of files then do some delete and then counts the files again to get how many files have been deleted.
Then it sends the resault by mail.
My question is, how can i send via mail the errors on this script? I mean, if the password is incorrect or that it was unable to mount, or whatever.
This is the script.
paste.ubuntu.com /15759934/
thanks.