Hello! Just registered with the forum after being a long time lurker and I've got a question...
I'm trying to get two RH servers to mount on the fly to two different Windows server shares to transfer some files across to both Windows servers.
If I execute the script manually (ie. ./script.sh) the mounts are created and subsequently unmounted and I can see this happening in front of me.
However, when I try and schedule the scripts to be executed at a specific time using crontab, the files are moved as they should be, but nothing appears to mount (as in I can't see anything appear on the Windows servers like I can when I manually run the .sh scripts).
Has anyone got any ideas why this should be the case? Could it be a permissions issue with exectuting the script from crontab? I'm definitely trying to do all of this as root, but I am a bit of a Red Hat newbie...
Here's my shell script:
Code:
# mount to Windows share
mount.cifs /mount/root/automation //[WINDOWS SERVER 1]/Import -o,username=import%import
# move file into automation
cd /mount/root/source
mv today.txt /mount/root/automation
# unmount Windows share
umount.cifs /mount/root/automation
Thanks in advance for any assistance... I can't work out why this should work manually but not via cron!