oops, files gone?
i was trying to make a script to redo a chmod on a folder every 15min. by using crontab (*/15 * * * * /(link to script.sh)
now i didn't know much about the use of the scrips so i just write in the command i would in terminal chmod -R 664 /data/ i try to run the script in terminal and now i can't see the files in that folder. but acording to the folder properties, i am still using the disc space where the data use to be, so the data in the folder doesn't seem to be deleted. the main focus i want is how to get the data back. scripting and others can come later. how can i get to see my data again? |
chmod will not make your data disapear. What makes you think your files are gone? What is the message you get when you do "ls -l" on the data directory? Paste that output here. You can restore the original permissions, if you know what they were.
|
The data is there, you have just stopped yourself from listing the directory contents (the "execute" bit on a directory allows its contents to be listed).
Quick fix by find /data -type d -exec chmod +x {} \; |
Although I'm not sure exactly what your requirements are, you probably want your script to read:
Code:
chmod -R 775 /data/ |
yeah i see the files now again. (chmod wikipedia confused me)
did a chmod 775 -R on the folder what about the script? don't know much about it, the only place i could find a chmod in script was php can i use that? <?php> chmod("/data/",-R,775) ?> |
You can use if if 775 are the permissions you wish to grant to that directory. Without knowing exactly what you are wanting to do, it is a difficult one to call. Post the output from
Code:
ls -l /data/ |
Below is some notes on how the numeric octal codes and how it breaks out into permissions and what it may mean if applied.
Quote:
|
All times are GMT -5. The time now is 03:55 PM. |