[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 890
  • Last Modified:

Linux Debian Cron Mount cifs issue

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
CanadaCouncil
Asked:
CanadaCouncil
  • 6
  • 3
1 Solution
 
omarfaridCommented:
are you providing full path name for the script as well?
0
 
CanadaCouncilAuthor Commented:
yes
the gnome-schedule  task call "bash /etc/bind_backup", I did provide the full path.
0
 
omarfaridCommented:
but bash it self without path name. Does it work with other scripts?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
CanadaCouncilAuthor Commented:
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
 
omarfaridCommented:
it looks like mount is not recognizing the file system type !
0
 
CanadaCouncilAuthor Commented:
As it turns out the script run but without the mount so it copies everything but not on the network.
0
 
CanadaCouncilAuthor Commented:
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
 
CanadaCouncilAuthor Commented:
I found a work arround thanks anyway...  I mount the drive in the /etc/fstab
0
 
CanadaCouncilAuthor Commented:
it is working
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now