davea0511
September 23rd, 2009, 03:54 AM
Sorry for the n00b question but even after hours of searching I can't seem to figure out what's probably obvious to everyone else.
I'm making a bash script that will let somebody refresh the content on a kiosk by plugging in a thumbdrive and rebooting the machine. Unfortunately bash script gives me a "permission denied" for many file operations.
Part of the problem is that Ubuntu is making everything on my thumbdrive that way. I've tried chmod to no avail, they still end up with 700 permissions:
###at bash prompt:
sudo chmod 777 /media/disk/*
ls -l /media/disk
====
###Output:
-rwx------ 1 user root 12697697 2006-10-25 08:42 Cpanels.swf
-rwx------ 1 user root 8574 2009-09-22 17:29 kioskLogistics.sh
-rwx------ 1 user root 4788 2009-09-22 12:26 kioskLogistics.sh~
-rwx------ 1 user root 18604854 2009-09-22 04:30 kiosk.swf
So if I start with read-only files, I'm going to have all kinds of problems once I copy them to the HD to manipulate with bash scripting because I'm stuck with the read-only, yes? I can't delete them or write over them.
Anyone show compassion to a n00b here? Does it have something to do with FSTAB (of which I really know practically nothing) to get the thumbdrives to mount not as -ro? O thought I could mount it myself as -rw but I get permission errors when I do that by bash. Even then, if they 755 bash script can't delete or write over them can it, unless it's root?
Again, I'm a newbie ... so if you just want to point me in the right direction that's cool.
I'm making a bash script that will let somebody refresh the content on a kiosk by plugging in a thumbdrive and rebooting the machine. Unfortunately bash script gives me a "permission denied" for many file operations.
Part of the problem is that Ubuntu is making everything on my thumbdrive that way. I've tried chmod to no avail, they still end up with 700 permissions:
###at bash prompt:
sudo chmod 777 /media/disk/*
ls -l /media/disk
====
###Output:
-rwx------ 1 user root 12697697 2006-10-25 08:42 Cpanels.swf
-rwx------ 1 user root 8574 2009-09-22 17:29 kioskLogistics.sh
-rwx------ 1 user root 4788 2009-09-22 12:26 kioskLogistics.sh~
-rwx------ 1 user root 18604854 2009-09-22 04:30 kiosk.swf
So if I start with read-only files, I'm going to have all kinds of problems once I copy them to the HD to manipulate with bash scripting because I'm stuck with the read-only, yes? I can't delete them or write over them.
Anyone show compassion to a n00b here? Does it have something to do with FSTAB (of which I really know practically nothing) to get the thumbdrives to mount not as -ro? O thought I could mount it myself as -rw but I get permission errors when I do that by bash. Even then, if they 755 bash script can't delete or write over them can it, unless it's root?
Again, I'm a newbie ... so if you just want to point me in the right direction that's cool.