Page MenuHomePhabricator

OCG Old files removal cron fails
Closed, ResolvedPublic

Description

Cron <ocg@ocg1003> find /srv/deployment/ocg/output* -mtime +5 -exec rm {} \;

rm: cannot remove ‘/srv/deployment/ocg/output’: Is a directory

I'm unsure why this cron is being run, perhaps to clear out old files?


Version: unspecified
Severity: trivial

Details

Reference
bz73166

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:59 AM
bzimport set Reference to bz73166.
bzimport added a subscriber: Unknown Object (MLST).

I also can not find the cron in puppet.

I don't think this cron job should exist any more. My guess is that an old puppet update removed this but forget to ensure => absent the old file?

Ah, that's likely.

Should we just manually remove it from the machines? How many are there anyway?

I'm going to look at this today during the OCG deploy window, and manually clean up the cron jobs if I can find them.

cscott@ocg1001:/etc$ sudo -u ocg -g ocg crontab -l

  1. HEADER: This file was autogenerated at 2014-07-28 18:00:32 +0000 by puppet.
  2. HEADER: While it can still be managed manually, it is definitely not recommended.
  3. HEADER: Note particularly that the comments starting with 'Puppet Name' should
  4. HEADER: not be deleted, as doing so could cause duplicate cron jobs.
  5. Puppet Name: Clean up OCG postmortem directory

0 0 * * * find /srv/deployment/ocg/postmortem* -mtime +3 -exec rm {} \;

Puppet Name: Clean up OCG output directory

0 0 * * * find /srv/deployment/ocg/output* -mtime +5 -exec rm {} \;

I haven't cleaned it up yet, but I did find it!

After looking through the puppet repo for the 'correct' syntax to ensure->absent a cronjob, I decided to just clean this up manually.

For the record, these cronjobs were removed in https://gerrit.wikimedia.org/r/151133 but not actually removed by puppet.

cscott@ocg1001:~$ sudo -u ocg -g ocg crontab -r
cscott@ocg1002:~$ sudo -u ocg -g ocg crontab -r
cscott@ocg1003:~$ sudo -u ocg -g ocg crontab -r
root@deployment-pdf01:~# sudo -u ocg -g ocg crontab -r
root@deployment-pdf02:~# sudo -u ocg -g ocg crontab -r