Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix retention script to delete really old files #33

Merged
merged 2 commits into from
Jun 8, 2017

Conversation

npwalker
Copy link
Owner

@npwalker npwalker commented Jun 6, 2017

Prior to this commit, the find command to delete old files would
only delete files exactly $retention_days older than when the
command is run. This means that if the script runs every day then
everything should be fine and no extra data is piling up. However,
if the server is off or the cron does not run for any reason then
extra data will be left behind as it will be older than the
retention_days parameter.

After this commit, the find command will delete files older than
the retention days parameter instead of exactly as old as the
retention_days parameter.

We also switch to ctime instead of mtime beacuse we care about when
the files were created not when they were last modified.

Prior to this commit, the find command to delete old files would
only delete files exactly $retention_days older than when the
command is run.  This means that if the script runs every day then
everything should be fine and no extra data is piling up.  However,
if the server is off or the cron does not run for any reason then
extra data will be left behind as it will be older than the
retention_days parameter.

After this commit, the find command will delete files older than
the retention days parameter instead of exactly as old as the
retention_days parameter.

We also switch to ctime instead of mtime beacuse we care about when
the files were created not when they were last modified.
@jarretlavallee
Copy link
Collaborator

👍 looks good to me

@npwalker npwalker merged commit 9bfbeec into master Jun 8, 2017
@npwalker npwalker deleted the fix_retention_script branch June 8, 2017 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants