Sponsored Content
Full Discussion: Setting up Cronjob
Operating Systems Linux Fedora Setting up Cronjob Post 302353683 by michealrp on Wednesday 16th of September 2009 12:48:29 AM
Old 09-16-2009
Sounds like your root umask is 002 which would leave you with a 705 rwx---r-x permissions by default on any files you edit as root. To set it for root files to be only rwx------ then set your umask to 077.

What is umask and how to setup default umask under Linux?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cronjob

Please can someone help me. I need to set up a cron job to measure CPU usage, Disk I/O and memory usage over a period of 1 minute along with the number of users logged into the system. I also need to send it to another user besides myself every hour. Please can someone help me! Thanks. (4 Replies)
Discussion started by: gerwhelan
4 Replies

2. Solaris

at vs cronjob

HI, What is the differnece between at / con job? thanks in advance. (1 Reply)
Discussion started by: mokkan
1 Replies

3. Shell Programming and Scripting

Cronjob

Hi, I'm totally new to shell scripting. I need help in my crontab script. I'm trying to read some values from user (username, log file directory, server) and then use those value to create a crontab for log rotation after some interval of time. creating crontabs manually isn't big deal.... (11 Replies)
Discussion started by: MisterKhan
11 Replies

4. UNIX for Dummies Questions & Answers

how to cancel a cronjob if the cronjob still running

hi everyone I'm newbie in this forum hope I can get some help here :) I have a command in crontab that executed every 1 minute sometime this command need more than 1 minute to finish the problem is, the crontab execute this command although it's not finish processing yet and causing the system... (7 Replies)
Discussion started by: 2j4h
7 Replies

5. UNIX for Dummies Questions & Answers

Cronjob help

Hi I am very new to linux. I want to run a cronjob every 15 minutes that checks a directory for files. If the directory contains more than ten files I want it to send an email to me. All I have is this... */15 * * * * ls -l | wc -l | | mail -s "This is just a test" I would... (2 Replies)
Discussion started by: LinuxNewb
2 Replies

6. UNIX for Dummies Questions & Answers

cronjob

Is the cronjob below can run only first wednesday of every month? 30 5 1-7 * 3 command please tell me (3 Replies)
Discussion started by: Anjan1
3 Replies

7. UNIX for Advanced & Expert Users

Help with cronjob setting

Hi everyone, I have set a cronjob to run every 5 minutes. But this has to be stopped between 1:00AM to 3:00AM. How do I do it? (3 Replies)
Discussion started by: VidyaVenugopal
3 Replies

8. Red Hat

Cronjob setting

Hi there There's a script I would like to run daily every 5 minutes and this job should restart every 12:03AM so it would append to a new file with the following day date format instead of running and updating continuously into one log. I am not sure of the syntaxing, what I did was to set it... (9 Replies)
Discussion started by: hedkandi
9 Replies

9. Solaris

Is there a difference between setting a user as nologin and setting it as a role?

Trying to figure out the best method of security for oracle user accounts. In Solaris 10 they are set as regular users but have nologin set forcing the dev's to login as themselves and then su to the oracle users. In Solaris11 we have the option of making it a role because RBAC is enabled but... (1 Reply)
Discussion started by: os2mac
1 Replies

10. UNIX for Beginners Questions & Answers

Cronjob

How to set cronjob for 48 hours. I can set for 2 days as shown below. * * */2 * * It is creating confusion for 30 days & 31 days per month. (3 Replies)
Discussion started by: Nishit
3 Replies
umask(1)						      General Commands Manual							  umask(1)

NAME
umask - Displays or sets the file mode creation mask SYNOPSIS
umask [-S] [mask] Note The C shell has a built-in version of the umask command. If you are using the C shell, and want to guarantee that you are using the com- mand described here, you must specify the full path /usr/bin/umask. See the csh(1) reference page for a description of the built-in com- mand. STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: umask: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. OPTIONS
Produce symbolic output. Output is produced in a format that is recognized on a subsequent invocation of umask as a mask operand to restore the previous file mode creation mask. If the -S option is not used, output is displayed as an octal integer, but is still usable as input on a subsequent invocation of the umask command. OPERANDS
A string specifying the new file mode creation mask. This string may may be an octal value or a symbolic_mode value. For a symbolic_mode value, the new value of the file mode creation mask is the logical complement of the file permission bits por- tion of the file mode specified by the symbolic_mode string. In a symbolic_mode value, the characters + and - are interpreted relative to the current file mode creation mask; + causes the bits for the indicated permissions to be cleared in the mask; - causes the bits for the indicated permissions to be set in the mask. The file mode creation mask is set to the resulting numeric value. In the obsolescent octal integer form of mode, the specified bits are set in the file mode creation mask. DESCRIPTION
The umask command sets the file mode creation mask of the current shell execution environment to the value specified by the mask oper- and. This mask affects the initial value of the file permission bits of subsequently created files. If the mask operand is not specified, the umask command writes the value of the invoking process's file mode creation mask to standard out- put. If the -S option is specified, the output is in the following format: "u=%s,g=%s,o=%s ", <owner permissions>, <group permissions>, <other permissions>" The three values are combinations of letters from the set {r, w, x}; the presence of a letter indicates that the corresponding bit is clear in the file mode creation mask. NOTES
Any mask operand such as -r, -w, -x, or anything beginning with a hyphen, must be preceded by -- to keep it from being interpreted as a option. Since umask affects the current shell execution environment, it is provided as a shell regular built-in. In contrast to the nega- tive permission logic provided by the file mode creation mask and the octal number form of the mask argument, the symbolic form of the mask operand specifies those permissions that are left alone. Although the references to octal modes are obsolescent in the ISO/IEC 9945-2:1993 standard, they are maintained for portable applications until further notice. RESTRICTIONS
If umask is called in a subshell or separate utility execution environment, it does not affect the file mode creation mask of the caller's environment. A separate execution environment could be one of the following: (umask 002) nohup umask ... find . -exec umask ... ; EXIT STATUS
The following exit values are returned: The file mode creation mask was successfully changed, or no mask operand was supplied. An error occurred. EXAMPLES
To set the file mode creation mask so that subsequently created files have their write by all others bit cleared, enter either of the fol- lowing commands: umask a=rx,ug+w umask 002 If the file mode creation mask was set with either of the above commands, the umask command can be used to write out the current value of the mask. To write the value in octal format, enter: umask This provides the output: 0002 To write the value in symbolic format, enter: umask -S This provides the output: u=rwx,g=rwx,o=rx The following sequence of commands is an example of how to save the current file mode creation mask and later restore the value using the umask command and octal integer formats. Examine the current value of the mask: umask The current mask is reported as: 022 Save the current value, and verify the saved value: SAVEMASK =`umask` echo $SAVEMASK The saved value is reported as: 022 Change the current mask: umask 444 Verify the change: umask The new mask is reported: 0444 Restore the previous mask: umask $SAVEMASK Verify the restored value: umask The value is now restored: 022 The following sequence of commands is an example of how to save the current file mode creation mask and later restore the value using the umask command and symbolic_mode formats. Examine the current value of the mask: umask -S The current mask is reported as: u=rwx,g=rx,o=rx Save the current value, and verify the saved value: SAVEMASK=`umask -S` echo $SAVE- MASK The saved value is reported as: u=rwx,g=rx,o=rx Change the current mask: umask a= Verify the change: umask -S The new mask is reported: u=,g=,o= Restore the previous mask: umask $SAVEMASK Verify the restored value: umask -S The value is now restored: u=rwx,g=rx,o=rx To set the file mode creation mask so that subsequently created files have all their write bits cleared, enter: umask -- -w ENVIRONMENT VARIABLES
The following environment variables affect the execution of umask: Provides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari- ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). Determines the locale for the for- mat and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of LC_MESSAGES. SEE ALSO
Commands: chmod(1) Functions: chmod(2), umask(2) Standards: standards(5) umask(1)
All times are GMT -4. The time now is 04:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy