tzahi
asked on
mkdir from perl script using crontab create limited permissions.
I am using perl script that remove directory and create another with the same name and the same path.
When running this script as root manually it is creating directory which is owned by root with permissins (777)when this script is running by crontab it is creating directory which is owned by root with permissins (771)when this script is running by crontab it is creating .
what should i do in order to run it from crontab but create with permissions(777)?
When running this script as root manually it is creating directory which is owned by root with permissins (777)when this script is running by crontab it is creating directory which is owned by root with permissins (771)when this script is running by crontab it is creating .
what should i do in order to run it from crontab but create with permissions(777)?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
But why there is difference between running it from crontab and from command line as root
use the umask function.
umask(0);
mkdir "directorytocreate", 0777;