LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 02-18-2008, 05:16 AM   #1
James H
LQ Newbie
 
Registered: Feb 2008
Posts: 2

Rep: Reputation: 0
Question Shell script can't mount using CIFS


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!
 
Old 02-18-2008, 05:50 AM   #2
James H
LQ Newbie
 
Registered: Feb 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Looks like all I needed to do was specify /sbin/mount.cifs and now it all works when run up by cron...
 
Old 02-18-2008, 07:17 AM   #3
mtimbro
Member
 
Registered: Feb 2008
Location: Montreal, Canada
Distribution: RedHat 3/4, Ubuntu 7.10
Posts: 86

Rep: Reputation: 15
Quote:
Originally Posted by James H View Post
Looks like all I needed to do was specify /sbin/mount.cifs and now it all works when run up by cron...
Yeah one suggestion I could give you is *always* specify full paths when wanting to automate jobs.

Cheers,
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cifs "mount error 13 = Permission denied" CIFS SUCKS humbletech99 Linux - Networking 45 04-06-2020 05:31 AM
Why does CIFS mount fail dhoyer Fedora 5 12-02-2009 10:42 AM
mount.cifs - mount error 20 = Not a directory da_kidd_er Linux - Networking 10 10-16-2008 12:55 PM
CIFS mount - no acl Unclesmiff Linux - Networking 3 03-06-2007 02:11 AM
mount smbfs vs cifs Zurvan Linux - Networking 2 12-29-2006 02:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 09:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration