Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

lisk_snapshot.sh - Bugfix #76

Merged
merged 1 commit into from
Feb 19, 2017
Merged

lisk_snapshot.sh - Bugfix #76

merged 1 commit into from
Feb 19, 2017

Conversation

Gr33nDrag0n69
Copy link
Contributor

DAYS_TO_KEEP cleanup command not working as expected

@@ -163,7 +163,7 @@ dropdb --if-exists "$TARGET_DB_NAME" &> /dev/null

echo -e "\n$(now) Deleting snapshots older then $DAYS_TO_KEEP day(s) in $BACKUP_LOCATION"
mkdir -p "$BACKUP_LOCATION" &> /dev/null
find "$BACKUP_LOCATION" -name "${SOURCE_DB_NAME}*.gz" -mtime +"$DAYS_TO_KEEP" -exec rm {} \;
find "$BACKUP_LOCATION" -name "${SOURCE_DB_NAME}*.gz" -mtime +"$(( DAYS_TO_KEEP - 1 ))" -exec rm {} \;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the original implementation doesnt work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep 1 day over

Copy link
Contributor Author

@Gr33nDrag0n69 Gr33nDrag0n69 Feb 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

days to keep =2 should result in keeping last 48 hours of files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not 72 hours

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If i say days to keep 7. Mtime +7 would keep 7 days and only delete things older than that, ie: 8 days.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

evrything else look like working perfectly in the last 3 days

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, i dont have time to test this now but i will do so later this week.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants