Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nick Bearson
eodn2realearth
Commits
bce2bfd7
Commit
bce2bfd7
authored
Dec 18, 2015
by
Nick Bearson
Browse files
added auto-purge of incoming, quarantine, and processing for files older than 64 days
parent
8b846ea7
Changes
2
Hide whitespace changes
Inline
Side-by-side
conf/crontab.table
View file @
bce2bfd7
# mondays @ 02:01
# mondays @ 02:01
, rotate the logs
1 2 * * 1 logrotate -f /home/eodn/eodn2realearth/conf/logrotate.conf -s /home/eodn/eodn2realearth/logs/rotate.status
# mondays @ 01:01, purge old files
1 1 * * 1 /home/eodn/eodn2realearth/src/purge.sh
src/purge.sh
0 → 100755
View file @
bce2bfd7
#!/usr/bin/env bash
set
-u
set
-e
DIR
=
"
${
BASH_SOURCE
%/*
}
"
if
[[
!
-d
"
$DIR
"
]]
;
then
DIR
=
"
$PWD
"
;
fi
.
"
$DIR
/consts.sh"
LOG
=
${
LOGS
}
/purge.log
exec
>>
$LOG
2>&1
DAYS_TO_KEEP
=
64
# landsat repeats every 16 days, keep 4 cycles? seems like we have the disk space
purge
()
{
find
$1
-mtime
${
DAYS_TO_KEEP
}
-type
f
-exec
echo
"PURGING: {}"
\;
-exec
rm
{}
\;
find
$1
-mtime
${
DAYS_TO_KEEP
}
-type
d
-exec
echo
"PURGING: {}"
\;
-exec
rm
-r
{}
\;
}
purge
$INCOMING
purge
$PROCESSING
purge
$QUARANTINE
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment