How to give full access to output files created by .sh script run via crontab?

Hi Expert,

I have a .sh script in my home/new_dir/script.sh

This script creates number of output files at home/new_dir/email, home/new_dir/logs dir.

I am running this script using crontab (owner root).

Now this output files are getting created with
rw-r----- 1 root root

So if i login with another user i cant access this file.
I want this files to be created with full access to all users.

Thanks

Put umask 0 at the top of your script, then any new files your script creates with have full access.

You will still need to manually update the access on any existing files your script appends/modifies.

1 Like

Thanks a lot for quick turn around.
And the solution worked.