Hi there, I'm very new to shell scripting so this may be incredibly simple to someone but:-
I've started using cron to automate some simple spam relocation and destruction. I want to see if there's a file called robinspam in dir /home/robin, and if there is I want to copy it, rename it, then move the copy to a folder and chmod it so anyone can read it from the ftp site. I'm getting a ' [ -e command not found ' message from cron when it tries to run it.
anyway here's the script. any help greatly appreciated as usual.
chz
ben
#!/bin/bash
if [-e /home/robin/robinspam ] ; then
cp /home/robin/spam /home/robin/robinspam
echo spam was found in mail directory robin
mv -f /home/robin/robinspam /ftpfolder/robinspam.txt
echo spam was duplicated and moved to the ftp folder
chmod o+r /ftpfolder/robinspam.txt
echo chmod on the file was successful anyone can read the file now
else
echo there was no spam found for user robin
fi