Re: HAMMER cleanup / periodic(8)
i guess that you can call an script in your crontab that does
something like this:
if( last_date_script_was_ran < today || last_date_script_was_run =3D=3D nul=
l) then
run clean up && last_day_script_was_run :=3D today
fi
you can save the last_day_script_was_run in /var/log maybe.
a little more complex, maybe the "last_time_cleanup_was_run_on_me" can
be recorded in pfs metadata (if it is not there already) and you can
add a parameter to "hammer cleanup" so you tell it to run only if "x
time passed since last run".
Damian
On Sun, Nov 22, 2009 at 10:59, Thomas Nikolajsen
<thomas.nikolajsen@mail.dk> wrote:
> We need by default to run 'hammer cleanup' every day system is running;
> also on systems not running at night.
>
> Otherwise snapshots won't be generated and HAMMER file system fills up.
> This will result in users not having the benefits from HAMMER they could.
>
> Our present default setup is to run 'hammer cleanup' daily by periodic(8)=
,
> which runs by default every night at 3 AM (via /etc/crontab).
> This is nice for systems running every night, typically servers.
> But it doesn't help newbies running systems not running every night.
>
> A year ago we had a good discussion on this topic;
> many good ideas and viewpoint were presented, see
> http://leaf.dragonflybsd.org/mailarchive/kernel/2008-10/index.html#00051
>
> I suggest that we by default run periodic(8) at reboot, delayed by 30 min=
utes.
> (periodic(8) run in background, like present default)
>
> This will by default run 'hammer cleanup' (by periodic/daily/160.clean-ha=
mmer),
> and also the other nice functionalities in the periodic(8) scripts,
> that systems not running at night in our present default setup won't run =
at all.
> Defaults, running periodic(8) at all and delay period, can be adjusted by=
user,
> and periodic(8) daily shall not run multiple times a day, this has to be =
handled.
>
> Doing this for a year, just using anacron(8), including periodic(8) in an=
acrontab,
> using a delay of a few minutes, I haven't seen any problems.
> (This is close to fulfill above requirements(*), good enough for my test)
> Anacron(8) doesn't fulfill requirements fully and can't be used in Dragon=
Fly base
> anyway (GPL licensed), but it is quite simple functionality, that we can =
write
> ourselves, I could do it if we like it.
>
> * periodic(8) can be run more than once a day: if system is running at 3 =
AM and
> is rebooted later the same day periodic(8) will run twice; this is rare i=
n my use.
>
> =C2=A0-thomas
>
--=20
http://dfbsd.trackbsd.org.ar
討論串 (同標題文章)