Why crontab umask not using default?
Issue
- When a file is created by root it shows permissions
644
, but when the file is created by cronjob in the same path it shows640
permissions (expected permissions are644
).
user: root
umask: 0022
/etc/crontab is default.
[root@server ~]# rpm -qa cronie*
cronie-1.4.4-12.el6.x86_64
cronie-anacron-1.4.4-12.el6.x86_64
[root@server ~]# umask
0022
[root@server ~]# /bin/ls -l /tmp/crontest/file_by_cron
-rw-r----- 1 root root 0 Oct 3 12:52 /tmp/crontest/file_by_cron
Environment
- Red Hat Enterprise Linux (RHEL) 6
- cronie-1.4.4-12.el6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.