From 855e3def51cb277cecc6c1e0b8707f9ef453bd4e Mon Sep 17 00:00:00 2001 From: Martin Polanka Date: Sat, 22 Oct 2016 12:32:14 +0200 Subject: [PATCH] usage --- Worker.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Worker.md b/Worker.md index 1405592..0d435c7 100644 --- a/Worker.md +++ b/Worker.md @@ -319,7 +319,7 @@ box3.cpus = 1,2,3 # assign list of processors to isolate box with id 3 ### Description Cleaner is integral part of **worker** which manages its cache folder, mainly deletes outdated files. Every cleaner maintains its one and only cache folder, which can be used by multiple workers. This means on one server there can be numerous instances of workers with the same cache folder, but there can be (and should be) only one cleaner. -Cleaner is written in **Python** and is used as simple script which just does its job and ends and therefore has to be cronned. On linux systems this can be done by built in `cron` service or if there is `systemd` present cleaner itself provides `*.timer` file which can be used for cronning from `systemd`. On Windows systems internal scheduler should be used. For proper function of cleaner some suitable cronning interval has to be used. Its recommended to use 24 hour interval which should be sufficient enough. +Cleaner is written in **Python** and is used as simple script which just does its job and ends and therefore has to be cronned. For proper function of cleaner some suitable cronning interval has to be used. Its recommended to use 24 hour interval which should be sufficient enough. #### Last access timestamp There is a bit of catch with cleaner service, to work properly, server filesystem has to have enabled last access timestamp. Cleaner checks these stamps and based on them it decides if file will be deleted or not, simple write timestamp or created at timestamp are not enough to reflect real usage and need of particular file. Last access timestamp feature is a bit controversial (more on this subject can be found [here](https://en.wikipedia.org/wiki/Stat_%28system_call%29#Criticism_of_atime)) and its not by default enabled on conventional filesystems. In linux this can be solved by adding `strictatime` option to `fstab` file. On Windows following command has to be executed (as administrator) `fsutil behavior set disablelastaccess 0`. @@ -358,4 +358,8 @@ cache-dir: "/tmp" file-age: "3600" # in seconds ``` -#### Usage \ No newline at end of file +#### Usage +As stated before cleaner should be cronned, on linux systems this can be done by built in `cron` service or if there is `systemd` present cleaner itself provides `*.timer` file which can be used for cronning from `systemd`. On Windows systems internal scheduler should be used. + +- Running cleaner from command line is fairly simple: `recodex-cleaner -c /etc/recodex/cleaner` +- Enable cleaner service using systemd: `systemctl start recodex-cleaner.timer` \ No newline at end of file