Solved

Linux Debian Cron Mount cifs issue

Posted on 2013-01-10
9
799 Views
Last Modified: 2013-11-13
I created a root task through the gnome-schedule to run the script below. The issue is that I get error but can't see why it won't mount the cifs. I can run this script without issues from a root terminal. I entered the full path of the command like some people suggest. I am using the bash with the script name when I run it from gnome-schedule. I also created a new task that just mount the drive and it is failing.

Any help would be appreciated.



Here is the script
-------------------------------------------------
#!/bin/bash
/bin/mount -t cifs //x.x.x.x/syslog -o  username=myusername,password=mypassword /mnt/nfs

/bin/mkdir -p /mnt/nfs/dns/`hostname`-`date +%m-%d-%y`/etc/bind
/bin/mkdir -p /mnt/nfs/dns/`hostname`-`date +%m-%d-%y`/var/lib/bind

/bin/cp -r /etc/bind/* /mnt/nfs/dns/`hostname`-`date +%m-%d-%y`/etc/bind
/bin/cp -r /var/lib/bind/* /mnt/nfs/dns/`hostname`-`date +%m-%d-%y`/var/lib/bind

/bin/umount /mnt/nfs
--------------------------------------------
0
Comment
Question by:CanadaCouncil
  • 6
  • 3
9 Comments
 
LVL 40

Expert Comment

by:omarfarid
ID: 38764510
are you providing full path name for the script as well?
0
 

Author Comment

by:CanadaCouncil
ID: 38764517
yes
the gnome-schedule  task call "bash /etc/bind_backup", I did provide the full path.
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 38764525
but bash it self without path name. Does it work with other scripts?
0
 

Author Comment

by:CanadaCouncil
ID: 38764550
I also created a task with

/bin/mount -t cifs //x.x.x.x/syslog -o  username=myusername,password=mypassword /mnt/nfs

and I get the same result the help from the mount command...

I tried a task without the "bash" and I get the same problem

See picture

I do have /mnt/nfs and if I manual
linux.gif
0
Save on storage to protect fatherhood memories

You're the dad who has everything. This Father's Day, make sure your family memories are protected. My Passport Ultra has automatic backup and password protection to keep your cherished photos and videos safe. With up to 3TB, you have plenty of room to hold the adventures ahead.

 
LVL 40

Expert Comment

by:omarfarid
ID: 38764618
it looks like mount is not recognizing the file system type !
0
 

Author Comment

by:CanadaCouncil
ID: 38764669
As it turns out the script run but without the mount so it copies everything but not on the network.
0
 

Author Comment

by:CanadaCouncil
ID: 38764678
To reply to the comment... It does reconize it but not entirely. Are there logs anywhere?  The script works when it is being executed as root!
0
 

Accepted Solution

by:
CanadaCouncil earned 0 total points
ID: 38768472
I found a work arround thanks anyway...  I mount the drive in the /etc/fstab
0
 

Author Closing Comment

by:CanadaCouncil
ID: 38782007
it is working
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is an explanation of a simple data model to help parse a JSON feed
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now