image
image

|


Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
Thread Tools
  #1  
Old March 8th, 2006, 12:27 PM
Registered User
 
Join Date: Feb 2005
Location: Spain
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
kandombe is on a distinguished road
mount_smbfs in crontab

I have some scheduled tasks whose results should go to a common computer so that other people can access them. That's why I have included in my .sh file a command such as

mount_smbfs //user:password@host/shared_folder /Volumes/shared_point
cp some_files
umount /Volumes/shared_point

The problem is that this script works perfectly when running from the Terminal but the samba remote volume refuses to mount when the process is activated from crontab.

Any ideas? Thanks in advance for the help.
Reply With Quote
  #2  
Old March 8th, 2006, 01:55 PM
tomdkat's Avatar
Registered User
 
Join Date: Aug 2005
Posts: 197
Thanks: 6
Thanked 0 Times in 0 Posts
tomdkat is on a distinguished road
Did you schedule the script to run as your id or as root? Try to schedule the script to run as root and see if that helps.

Either su to root and schedule it via cron or use sudo.

I'm sure more experienced OS X users will supply a better solution.

Peace...
Reply With Quote
  #3  
Old March 9th, 2006, 11:06 AM
Registered User
 
Join Date: Feb 2005
Location: Spain
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
kandombe is on a distinguished road
Thanks for the idea but it didn't work, and it is not logical that a script that runs ok when launched from the Terminal doesn't work when scheduled with crontab.
I've even tried to change the permissions in crontab by doing
chmod u-s /usr/bin/crontab
in case that it's assuming another user ID when running the task, but it didn't work either.
I'm running out of ideas. Any help will be welcome.
Reply With Quote
  #4  
Old March 9th, 2006, 11:25 AM
Registered User
 
Join Date: Feb 2005
Location: Spain
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
kandombe is on a distinguished road
Sorry to all. I was soooo stupid

I just forgot to establish the PATH environment at the beginning of my script, so it worked from the Terminal (sure) but couldn't find the mount_smbfs location when launched from crontab.
Reply With Quote
  #5  
Old March 9th, 2006, 06:08 PM
tomdkat's Avatar
Registered User
 
Join Date: Aug 2005
Posts: 197
Thanks: 6
Thanked 0 Times in 0 Posts
tomdkat is on a distinguished road
Glad you got it figured out! How did you come to the conclusion it was a lack of PATH setting?

Peace...
Reply With Quote
  #6  
Old March 10th, 2006, 03:13 AM
Registered User
 
Join Date: Feb 2005
Location: Spain
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
kandombe is on a distinguished road
Just looking to other scripts that I had prepared using the snmp package, in which I had included the path to find the snmp commands. That's why I felt so stupid, because I made a mistake that I had easily avoided before.

In any case, I'd like to write it clearly here in case that it can be useful to somebody in the future.

I like your way of ending the messages.

Peace ...
Reply With Quote
  #7  
Old March 10th, 2006, 10:28 AM
tomdkat's Avatar
Registered User
 
Join Date: Aug 2005
Posts: 197
Thanks: 6
Thanked 0 Times in 0 Posts
tomdkat is on a distinguished road
Quote:
Originally Posted by kandombe
Just looking to other scripts that I had prepared using the snmp package, in which I had included the path to find the snmp commands. That's why I felt so stupid, because I made a mistake that I had easily avoided before.
Cool.

Quote:
I like your way of ending the messages.

Peace ...
Yeah, that's something I tend to do. My "trademark", so to speak. If you're familiar with the rap artist "Chubb Rock", that's how he closes the song, "Treat 'em right"

Peace...
Reply With Quote
Reply

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
smbutil and mount_smbfs dsnyder Unix & X11 1 July 25th, 2006 12:57 PM
crontab and lynx yogi_kudu Unix & X11 1 May 8th, 2003 11:45 AM
PHP and Crontab Zimbop Design & Media 11 December 5th, 2002 09:31 AM
proper format for mount_smbfs? Lazarus18 Mac OS X System & Mac Software 1 November 3rd, 2001 02:30 AM
crontab and atrun gumse Mac OS X System & Mac Software 5 May 7th, 2001 04:13 PM


All times are GMT -5. The time now is 09:43 PM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.