Solved

mkdir from perl script using crontab create limited permissions.

Posted on 1998-11-18
3
334 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows 10 - Devices and Printers slow loading 29 726
SCCM, SCOM or Something Else 6 61
How to fid Policy on particular IP Address 5 49
Price for Fiber 13 64
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

749 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