HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Cron job behaviour
Operating System - HP-UX
1826215
Members
2819
Online
109691
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2004 09:44 PM
08-30-2004 09:44 PM
Cron job behaviour
Hi all,
I have some questions cron job behaviour:
Question 1
==========
For directory
/home/appl mode: 777 owned by appluserA:applgroup
appluserB (same group of appluserA), create /home/appl/file, mode:640, owned by appluserB:applgroup
a. appluserA telnet to server, rm /home/appl/file
it returned "640 mode (y/n)?"
b. appluserA uses cron job "rm /home/appl/file", it removed without any warning/question
Why cron job can remove file without "rm -f" option ?
Question 2
==========
In directory /home/appl,
a. telnet and create file /home/appl/file, mode is 666
When run umask, it showed 00
b. Use cron job to create file /home/appl/file,
mode is 644
When run umask, it showed 022
Why the umask is different ? Where to set the global umask ?
I just know cron job is difference from telnet as cron job is not "logged on" to server, so /etc/profile and .profile are not called.
Thanks
I have some questions cron job behaviour:
Question 1
==========
For directory
/home/appl mode: 777 owned by appluserA:applgroup
appluserB (same group of appluserA), create /home/appl/file, mode:640, owned by appluserB:applgroup
a. appluserA telnet to server, rm /home/appl/file
it returned "640 mode (y/n)?"
b. appluserA uses cron job "rm /home/appl/file", it removed without any warning/question
Why cron job can remove file without "rm -f" option ?
Question 2
==========
In directory /home/appl,
a. telnet and create file /home/appl/file, mode is 666
When run umask, it showed 00
b. Use cron job to create file /home/appl/file,
mode is 644
When run umask, it showed 022
Why the umask is different ? Where to set the global umask ?
I just know cron job is difference from telnet as cron job is not "logged on" to server, so /etc/profile and .profile are not called.
Thanks
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2004 10:17 PM
08-30-2004 10:17 PM
Re: Cron job behaviour
I'm not so sure but...
Question 1) Cron jobs run as root user...so they can delete files bypassing permissions.
Question 2) you have to check .profile files
When you make telnet you have to check the profile of the user who makes telnet (umask setting in user profile .profile)...when you use cron job you have to check the global setting.../etc/profile and set umask in this file.
I hope to help you.
Emanuele
Question 1) Cron jobs run as root user...so they can delete files bypassing permissions.
Question 2) you have to check .profile files
When you make telnet you have to check the profile of the user who makes telnet (umask setting in user profile .profile)...when you use cron job you have to check the global setting.../etc/profile and set umask in this file.
I hope to help you.
Emanuele
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2004 02:24 AM
08-31-2004 02:24 AM
Re: Cron job behaviour
Hi,
1) Cron jobs have the rights of the user who execute the job. If rm command is using in a root cron job, it's normal that files are removed without -f option because root has all permissions on files.
2) For security reasons, no user profile is read by cron job. You can set ENV variables into scripts separately. If you want to read a profile you must specify it:
a) in the script or
b) on each line in cron file:
* * * * * . YourProfileFile ; YourCronScript
Rgds
JMB
1) Cron jobs have the rights of the user who execute the job. If rm command is using in a root cron job, it's normal that files are removed without -f option because root has all permissions on files.
2) For security reasons, no user profile is read by cron job. You can set ENV variables into scripts separately. If you want to read a profile you must specify it:
a) in the script or
b) on each line in cron file:
* * * * * . YourProfileFile ; YourCronScript
Rgds
JMB
Si vous ne faites jamais de bétises, c'est que vous ne faites rien de difficile. Et ça c'est une grosse bétise.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2004 05:31 AM
08-31-2004 05:31 AM
Re: Cron job behaviour
Hi,
the following is a quote from man rm
greetings,
Michael
If a user does not have write permission for a file to be removed and standard input is a terminal, a prompt containing the file name and its permissions is printed requesting that the removal of the file be confirmed (see Access Control Lists below). A line is then read from standard input. If that line begins with y the file is deleted; otherwise, the file remains. No questions are asked when the -f option is given or if standard input is not a terminal
the following is a quote from man rm
greetings,
Michael
If a user does not have write permission for a file to be removed and standard input is a terminal, a prompt containing the file name and its permissions is printed requesting that the removal of the file be confirmed (see Access Control Lists below). A line is then read from standard input. If that line begins with y the file is deleted; otherwise, the file remains. No questions are asked when the -f option is given or if standard input is not a terminal
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP