Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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:
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.