Hi, First, my apologies for just disappearing but unfortunately something came up. Secondly, Happy New Year to everyone. Thirdly ... my script problem.
I took away the second pipe yesterday and everything worked as intended overnight. I have no idea why the second pipe would have interfered as the syntax is perfectly correct (thanks) but anyhow ... As a matter of personal interest I tried it without sudo in front on a test this morning. It mounted but did not umount. No problem, just interest/learning. I checked the job command and confirmed the initial / was there, so again I don't know why that error showed up. Please accept my thanks and gratitude for your help and patience. David On Mon, 2008-12-29 at 17:20 +1000, Lisa Milne wrote: > Looks like you're missing the / off the front of the command you entered > in gnome-schedule > > > > On Mon, 2008-12-29 at 14:59 +1100, David Ryder wrote: > > Hi, > > The output of mountlog was: > > > > /bin/sh: usr/local/bin/unmount-hardy32-backups.sh: not found > > ___ > > The file is: > > /usr/local/bin/unmount-hardy32-backups.sh > > ___ > > The command is: > > sudo "umount /media/hardy32-backups >> /home/david/mountlog 2>&1" > > >> /home/david/mountlog 2>&1 > > (one line) > > > > I don't know, therefore, why it reports file not found. I also note the > > error log leaves out the first / > > > > Many thanks > > David > > > > On Mon, 2008-12-29 at 13:26 +1000, Lisa Milne wrote: > > > Alright see if you can get some output from the script when it runs > > > then. > > > > > > in gnome schedule for the task, untick the "no output" checkbox, and add > > > this to the end of the command: > > > > > > > /home/USER/mountlog 2>&1 > > > > > > so the command will look something like: > > > > > > umount.sh > /home/david/mountlog 2>&1 > > > > > > and change the script to look something like: > > > > > > #!/bin/sh > > > sudo "umount /media/hardy32-backups >> /home/david/mountlog 2>&1" > > > >> /home/david/mountlog 2>&1 > > > > > > the command should all be on one line. not 2 like it shows as I've > > > written it. It's probably overkill on the redirects, I just wanna make > > > sure we catch everything. > > > > > > Next time the task runs you should have a file in your home directory > > > called mountlog containing all the output from the task, the script, and > > > sudo... so we can see what is happening and why it's failing. > > > > > > > > > > > > On Mon, 2008-12-29 at 13:30 +1100, David Ryder wrote: > > > > Nope - running as root still doesn't unmount it - I have to unmount it > > > > by running in terminal, still. > > > > I have tried the script with and without the sudo command in the script > > > > file. > > > > Any suggestions on how to mount and unmount ntfs or ext3 files (drives) > > > > not in fstab using scripts? > > > > > > > > I don't understand why it won't umount via a root cron job bit will > > > > using the same script with the "Run in Terminal" option. > > > > > > > > David > > > > > > > > On Mon, 2008-12-29 at 12:33 +1100, David Ryder wrote: > > > > > I've set it up as root - it mounted OK. I am waiting 'til 1p.m. (half > > > > > an > > > > > hour) for the second script to run so I can be sure the password > > > > > requirement has timed out ... > > > > > Thanks - I'll post the results. > > > > > David > > > > > On Mon, 2008-12-29 at 11:01 +1000, Lisa Milne wrote: > > > > > > Are you running gnome-schedule as a regular user or as root? > > > > > > > > > > > > try running it as root with > > > > > > gksudo gnome-schedule > > > > > > > > > > > > setup the task as usual and it should work now > > > > > > > > > > > > > > > > > > > > > > > > On Mon, 2008-12-29 at 11:43 +1100, David Ryder wrote: > > > > > > > I used Configure Scheduled Tasks (gnome-schedule in synaptic). > > > > > > > Is that what you mean by setting the cron job or have I > > > > > > > misinterpreted > > > > > > > you? > > > > > > > Many thanks, > > > > > > > David > > > > > > > On Mon, 2008-12-29 at 10:28 +1000, Lisa Milne wrote: > > > > > > > > How are you setting the cron job? > > > > > > > > Are you setting it as root? > > > > > > > > As I don't see this working if you were to set it as a normal > > > > > > > > user. > > > > > > > > > > > > > > > > > > > > > > > > On Mon, 2008-12-29 at 11:23 +1100, David Ryder wrote: > > > > > > > > > Hi, > > > > > > > > > Hardy 8.10 > > > > > > > > > > > > > > > > > > Please can anybody in the list help with this? It is driving > > > > > > > > > me nuts. > > > > > > > > > > > > > > > > > > I hava a physically separate ntfs drive that I use for > > > > > > > > > backups. It makes > > > > > > > > > no difference if I format it ext3. The drive is not in fstab > > > > > > > > > as I do not > > > > > > > > > want it mounted automatically nor all the time. Keeping it in > > > > > > > > > Places>Removable Media suits me fine. > > > > > > > > > > > > > > > > > > I have two scripts - one to mount it and the second to > > > > > > > > > unmount it. The > > > > > > > > > latter will not run under cron and will only "Run In > > > > > > > > > Terminal". I am > > > > > > > > > denied permission to unmount it by clicking on it. > > > > > > > > > > > > > > > > > > The drive is called hardy32-backups and I have made a folder > > > > > > > > > called > > > > > > > > > hardy32-backups in /media/ - without it the first script will > > > > > > > > > not run. > > > > > > > > > > > > > > > > > > The scripts are in /usr/local/bin and Schedule Tasks has the > > > > > > > > > right path > > > > > > > > > to them: > > > > > > > > > 1. mount hardy-32-backups.sh runs at 4am and > > > > > > > > > 2. unmount hardy-32-backups.sh (should) runs at 7am. > > > > > > > > > > > > > > > > > > 1. mount hardy-32-backups.sh script runs fine - it contains: > > > > > > > > > #!/bin/sh > > > > > > > > > sudo mount UUID=764809814809417B /media/hardy32-backups > > > > > > > > > > > > > > > > > > 2. unmount hardy-32-backups.sh does not run - which is my > > > > > > > > > problem. It > > > > > > > > > contains: > > > > > > > > > #!/bin/sh > > > > > > > > > sudo umount /media/hardy32-backups/ > > > > > > > > > > > > > > > > > > I have tried: > > > > > > > > > sudo umount UUID=764809814809417B /media/hardy32-backups > > > > > > > > > sudo umount UUID=764809814809417B > > > > > > > > > sudo umount /hardy32-backups > > > > > > > > > sudo umount /hardy32-backups/ > > > > > > > > > without any luck as well as running without sudo in front. > > > > > > > > > > > > > > > > > > When mounted by the script it appears on the desktop and in > > > > > > > > > mtab as: > > > > > > > > > /dev/sdi1 /media/hardy32-backups fuseblk > > > > > > > > > rw,nosuid,nodev,noatime,allow_other,blksize=4096 0 0 > > > > > > > > > but please note it is not always sdbi1 after a reboot. > > > > > > > > > > > > > > > > > > I just can't get it to umount via cron. Any help would be > > > > > > > > > very much > > > > > > > > > appreciated, thanks. > > > > > > > > > > > > > > > > > > David > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > WebLinux - Linux live on the web! > > > > > > > > http://www.weblinux-live.org > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > WebLinux - Linux live on the web! > > > > > > http://www.weblinux-live.org > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > WebLinux - Linux live on the web! > > > http://www.weblinux-live.org > > > > > > > > > -- > WebLinux - Linux live on the web! > http://www.weblinux-live.org > > -- ubuntu-au mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-au
