Task #90


Feature #82: Implement a work copy of our website

Task #9: Add a cron script to make a static copy of Spip

Purge old website snapshot directories

Added by Jean-Michel Philippe about 13 years ago. Updated over 12 years ago.

Ready for test
Target version:
Start date:
Due date:
05/16/2011 (over 13 years late)
% Done:


Estimated time:
2:00 h
Spent time:


Now that the daily cron task is on, we get a new snapshot directory everyday. Only two of them are actually used:

  • the snapshot pointed by web/ is the official website and must not be removed
  • the snapshot of the day, which is pointed by test/

All other snapshot directories can be purged. We can however decide to keep say 10 of them for security reasons or to be able to perform stats on size or nbr. of files.

Related issues 2 (1 open1 closed)

Follows (1 day) Website - Feature #91: Create the cron task for website snapshotsClosedJean-Michel Philippe05/06/2011

Precedes (1 day) Website - Feature #92: Define a way to automatically put online a snapshotReady for testJean-Michel Philippe06/01/201112/26/2011

Actions #1

Updated by Jean-Michel Philippe about 13 years ago

  • Due date set to 05/16/2011
  • Start date changed from 05/30/2011 to 05/09/2011
Actions #2

Updated by Jean-Michel Philippe over 12 years ago

  • Status changed from New to In Progress

Older directories to be removed can be listed with this command:

$ find . -maxdepth 1 -name 'snapshot-*' -mtime +5 | sort

It is possible to remove a particular directory from the list:

$ find . -maxdepth 1 -name 'snapshot-*' ! -name 'snapshot-20111117' | sort

This can be used to ignore the directory which is pointed by web/:

$ find . -maxdepth 1 -name 'snapshot-*' ! -name $(basename "$(readlink web)") | sort

Finally, the command that lists old directories not being the target of the symlink web/ is:

$ find . -maxdepth 1 -name 'snapshot-*' -mtime +5 ! -name $(basename "$(readlink web)") | sort

Note that if the symlink is regularly updated, it should not appear in the list of old directories. Moreover the code deleting directories must be disabled when the symlink cannot be moved to the latest snapshot, due to mirroring errors.

Actions #3

Updated by Jean-Michel Philippe over 12 years ago

  • Status changed from In Progress to Ready for test
  • % Done changed from 0 to 90

The code is online with removal code commented out :). We have to check that everything is fine during weeks before putting all into automatic mode.


Also available in: Atom PDF