Link to home
Start Free TrialLog in
Avatar of tf2012
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?
SOLUTION
Avatar of Austin Texas
Austin Texas
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tf2012
tf2012

ASKER

The script is being run using crontab.  It's a Debian Wheezy distro and the USB file system is fat32
Avatar of tf2012

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.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tf2012

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!