Skip to content

Instantly share code, notes, and snippets.

@udzura
Created October 6, 2015 06:00
Show Gist options
  • Save udzura/145235b2b090bda4bc44 to your computer and use it in GitHub Desktop.
Save udzura/145235b2b090bda4bc44 to your computer and use it in GitHub Desktop.
describe 'cron on log' do
describe cron do
def self.expect_to_have_tempwatch_entry_of(dir, deletes_before: 24 * 30 * 1)
it {
should have_entry("0 3 * * * /usr/sbin/tmpwatch -m #{deletes_before} -d #{dir}")
.with_user('root')
}
end
expect_to_have_tempwatch_entry_of "/data/log/foo", deletes_before: 24 * 30 * 1
expect_to_have_tempwatch_entry_of "/data/log/foo/www-", deletes_before: 24 * 14
expect_to_have_tempwatch_entry_of "/data/log/foo/www-ssl", deletes_before: 24 * 14
expect_to_have_tempwatch_entry_of "/data/log/foo/other", deletes_before: 24 * 14
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment