LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't umount Through Scheduler (https://www.linuxquestions.org/questions/linux-newbie-8/cant-umount-through-scheduler-4175424270/)

PaulyWally 08-27-2012 02:36 PM

Can't umount Through Scheduler
 
Running Debian Squeeze.

I wrote a bash script to do some backups over a small network (with wired and wireless devices). It mounts network shares, performs rsync on that share, and then umounts the network share.

The user account logged in is "backupaccount". And when I run the script manually through cli, it runs fine. But I wanted to use Gnome Scheduler to schedule it to run at certain days/times. Everything in the script seems to run fine except it will not umount the network shares. The error is:

Code:

umount: /home/backupaccount/BackupData/MntNetworkShares/TestShare1 mount disagrees with the fstab
Since it umounts fine when I run the script manually, I assume it is a permissions issue. But am unsure where to look since there are no permission options in Gnome Scheduler.

Any help is appreciated! Thanks in advance!

Here is my fstab:
Code:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>  <type>  <options>      <dump>  <pass>
proc            /proc          proc    defaults        0      0
# / was on /dev/sda2 during installation
UUID=2ed67db7-acd7-4d71-84d8-fa0fd7950d8c /              ext3    errors=remount-ro 0      1
# swap was on /dev/sda5 during installation
UUID=2bfb3b81-edea-4b15-bbd9-34efbb47a46b none            swap    sw              0      0
/dev/scd0      /media/cdrom0  udf,iso9660 user,noauto    0      0

# This is where the removable backup media gets mounted
/dev/sdb1        /home/backupaccount/BackupData/MntBackupMedia        auto        noauto,users,noexec,rw,noatime,sync,umask=0        0        0

# These are the network shares that need to be mounted to get backed up
# //Server/Share        /home/backupaccount/BackupData/MntNetworkShares        cifs        noauto,guest,_netdev,users,ro        0        0
//winxp01/TestShare1$        /home/backupaccount/BackupData/MntNetworkShares/TestShare1        cifs        noauto,guest,_netdev,users,ro        0        0
//winxp01/TestShare2$        /home/backupaccount/BackupData/MntNetworkShares/TestShare2        cifs        noauto,guest,_netdev,users,ro        0        0
//winxp01/TestShare3$        /home/backupaccount/BackupData/MntNetworkShares/TestShare3        cifs        noauto,guest,_netdev,users,ro        0        0

And my mtab after scheduler has run the script and failed the umounts:

Code:

/dev/sda2 / ext3 rw,errors=remount-ro 0 0
tmpfs /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
udev /dev tmpfs rw,mode=0755 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0
fusectl /sys/fs/fuse/connections fusectl rw 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0
/dev/sdb1 /home/backupaccount/BackupData/MntBackupMedia vfat rw,noexec,nosuid,nodev,sync,noatime,umask=0 0 0
//winxp01/TestShare1$/ /home/backupaccount/BackupData/MntNetworkShares/TestShare1 cifs ro,mand,nosuid,nodev,user=backupaccount 0 0
//winxp01/TestShare2$/ /home/backupaccount/BackupData/MntNetworkShares/TestShare2 cifs ro,mand,nosuid,nodev,user=backupaccount 0 0
//winxp01/TestShare3$/ /home/backupaccount/BackupData/MntNetworkShares/TestShare3 cifs ro,mand,nosuid,nodev,user=backupaccount 0 0


MensaWater 08-27-2012 03:23 PM

It may not be the umount that is the issue but rather the original mount. You might want to add a line to show what the mount is before you do the umount for debugging purposes e.g.

df -hP /home/backupaccount/BackupData/MntNetworkShares/TestShare1

Verify output of that line shows it is mounted from device, //winxp01/TestShare1. If not then that is your problem and you should focus on the mount you're doing to test its success before you do this.

Often things that work fine at command line don't work via automated tools such as cron, init scripts and other schedulers because the user environment you have at command line is built by running profiles but such profiles aren't run by the automated tools. It is necessary therefore to insure the script itself has the correct environmental variables.

P.S. rsync is designed to communicate over network for synchronization - have you thought about installing rsync on the host you're trying to copy from (or to) and avoid the mount altogether?


All times are GMT -5. The time now is 07:29 AM.