Solved

mkdir from perl script using crontab create limited permissions.

Posted on 1998-11-18
3
332 Views
Last Modified: 2013-12-23
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)?  
 
0
Comment
Question by:tzahi
3 Comments
 
LVL 1

Accepted Solution

by:
arthurd earned 50 total points
ID: 1582621
Use chmod in your perl program:

chmod (0777,"DIRECTORY");


0
 
LVL 22

Expert Comment

by:blu
ID: 1582622
In the perl script, before creating the new directories,
use the umask function.

umask(0);
mkdir "directorytocreate", 0777;

0
 

Author Comment

by:tzahi
ID: 1582623
But why there is difference between  running it from crontab and from command line  as root
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Setting up a VPN 60 181
Reccomended programming language for client-server applications 12 129
ISP Change 14 63
HP 1920 Switch -- IFNET LINK_UPDOWN Errors 3 15
This is an article about my experiences with remote access to my clients (so that I may serve them) and eventually to my home office system via Radmin Remote Control. I have been using remote access for over 10 years and have been improving my metho…
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question