I have a cron tab file , which executes a particular script in a scheduled time and creates a output file. Since the cron tab file was created by the root , there is no access permission( for the output files) for other users irrespective of the default directory permission on which the output file is created.
You could make use of the setgid bit and create a directory where you write just that log file into. Assign a group to that directory, where the users are in that should be allowed to read the output, set the permission bits with chmod on the directory accordingly and have the setgid bit being set too.
@vbe , thank you so much .. but adding a chmod line is not working fine . moreover if I am really not sure of the output file name created , how this method will be helpful.
@Zaxxon, things are not working fine , as you have mentioned. I did things as you mentioned, but again the files are created with priveleges for root only :wall: