tf2012
asked on
bash script question (chmod)
I'm using a bash script on boot to change permissions on two files like this
#! /bin/bash
cp -R /media/usb/update/* /home/icop/dp #don't worry about his, it does the job of copying just fine..tested
chmod 755 /home/me/app/jump.py
chmod 755 /home/me/app/smile.py
however when I check the permissions from the command line I see this:
--wxrw--wt 1 me me jump.py
--wxrw--wt 1 me me smile.py
neither of which are executable until I go to the command line and chmod 755. How can ensure the chmod 755 works from the bash script?
#! /bin/bash
cp -R /media/usb/update/* /home/icop/dp #don't worry about his, it does the job of copying just fine..tested
chmod 755 /home/me/app/jump.py
chmod 755 /home/me/app/smile.py
however when I check the permissions from the command line I see this:
--wxrw--wt 1 me me jump.py
--wxrw--wt 1 me me smile.py
neither of which are executable until I go to the command line and chmod 755. How can ensure the chmod 755 works from the bash script?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The home/icop/dp part is a typo from I forum sample I was using. Path is /home/me/app
When I check /home/me/app/jump with lsattr, the only flag is e. It doesn't appear to be immutable.
When I check /home/me/app/jump with lsattr, the only flag is e. It doesn't appear to be immutable.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Found the problem. The chmod command in the crontab invoked bash script was actually working. What I found was that my final step, a python script that updated the crontab when everything else finished was also doing redundant chmod commands. So I removed them from the python script and left the chmod commands in the crontab bash script as shown above and ta-da... it works.
Thanks for the help!
Thanks for the help!
ASKER