Re: [CentOS] Cronjob and sudo

2015-02-12 Thread Matt
>> I need to remove empty files out of a directory that are over 6 hours >> old so I created this script and put it in cron.hourly. > > For what it's worth, we no longer have requiretty in the package in > Fedora, so eventually that change will probably make it down to CentOS. > Overall, security b

Re: [CentOS] Cronjob and sudo

2015-02-12 Thread Valeri Galtsev
On Thu, February 12, 2015 12:45 pm, Valeri Galtsev wrote: > > On Thu, February 12, 2015 12:32 pm, Matt wrote: >> I need to remove empty files out of a directory that are over 6 hours >> old so I created this script and put it in cron.hourly. >> >> #!/bin/sh >> cd /var/list >> sudo -u matt find /va

Re: [CentOS] Cronjob and sudo

2015-02-12 Thread Matthew Miller
On Thu, Feb 12, 2015 at 12:32:12PM -0600, Matt wrote: > I need to remove empty files out of a directory that are over 6 hours > old so I created this script and put it in cron.hourly. For what it's worth, we no longer have requiretty in the package in Fedora, so eventually that change will probabl

Re: [CentOS] Cronjob and sudo

2015-02-12 Thread Valeri Galtsev
On Thu, February 12, 2015 12:32 pm, Matt wrote: > I need to remove empty files out of a directory that are over 6 hours > old so I created this script and put it in cron.hourly. > > #!/bin/sh > cd /var/list > sudo -u matt find /var/list -mmin +360 -empty -user matt -exec rm {} \; > > I want to run

Re: [CentOS] Cronjob and sudo

2015-02-12 Thread Mauricio Tavares
On Thu, Feb 12, 2015 at 1:32 PM, Matt wrote: > I need to remove empty files out of a directory that are over 6 hours > old so I created this script and put it in cron.hourly. > > #!/bin/sh > cd /var/list > sudo -u matt find /var/list -mmin +360 -empty -user matt -exec rm {} \; > What if you

Re: [CentOS] Cronjob and sudo

2015-02-12 Thread Larry Martell
On Thu, Feb 12, 2015 at 1:32 PM, Matt wrote: > I need to remove empty files out of a directory that are over 6 hours > old so I created this script and put it in cron.hourly. > > #!/bin/sh > cd /var/list > sudo -u matt find /var/list -mmin +360 -empty -user matt -exec rm {} \; > > I want to run it

Re: [CentOS] Cronjob and sudo

2015-02-12 Thread Eero Volotinen
You can disable requiretty for one user also: https://linuxreference.wordpress.com/2010/11/22/disable-requiretty-in-etcsudoers/ -- Eero 2015-02-12 20:32 GMT+02:00 Matt : > I need to remove empty files out of a directory that are over 6 hours > old so I created this script and put it in cron.hour

[CentOS] Cronjob and sudo

2015-02-12 Thread Matt
I need to remove empty files out of a directory that are over 6 hours old so I created this script and put it in cron.hourly. #!/bin/sh cd /var/list sudo -u matt find /var/list -mmin +360 -empty -user matt -exec rm {} \; I want to run it as matt rather than root for just an added bit of safety.