Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Jul 2016 18:19:37 +0100
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: /etc/periodic question
Message-ID:  <0542d31e-53c6-3951-bff5-c0fef5e98ab3@freebsd.org>
In-Reply-To: <BC66F5DC-4812-42FA-9C0E-4A0F70B003A2@shinnok.com>
References:  <BC66F5DC-4812-42FA-9C0E-4A0F70B003A2@shinnok.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--s8Qqb6JRPiPgcQLsxsE4OI7L4r998HK8E
Content-Type: multipart/mixed; boundary="9ivsD019Hw0RoMluQVgGQRxF97GRvcPvb"
From: Matthew Seaman <matthew@freebsd.org>
To: freebsd-questions@freebsd.org
Message-ID: <0542d31e-53c6-3951-bff5-c0fef5e98ab3@freebsd.org>
Subject: Re: /etc/periodic question
References: <BC66F5DC-4812-42FA-9C0E-4A0F70B003A2@shinnok.com>
In-Reply-To: <BC66F5DC-4812-42FA-9C0E-4A0F70B003A2@shinnok.com>

--9ivsD019Hw0RoMluQVgGQRxF97GRvcPvb
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 07/22/16 17:23, Shinnok wrote:
> Is /etc/periodic daily, weekly, monthly scheduling more like anacron
> than cron?
>=20
> Cron will skip a schedule if the system is off or hibernating,
> whereas anacron will execute with the next opportunity, thus no
> missed intervals.
>=20
> If not, then what's the best option for scheduling tasks on non
> 24hour systems like laptops?

It's not just cron-like -- periodic scripts literally are run from the
system crontab file /etc/crontab. That means if your machine is switched
off or hibernating overnight, the default periodic jobs simply won't be r=
un.

There are a few solutions to this you might want to consider:

   - change the time that the periodic jobs run to some time when the
     machine is more likely to be up.  Note that periodic jobs can
     involve quite a lot of disk IO, and this may have a noticeable
     affect on performance.

   - Install anacron from ports and use that instead.  Don't forget to
     disable the entries in the system crontab, or you'll be bound to
     end up with the periodic jobs running twice at some unexpected
     time in the future.

   - Don't worry about running periodic jobs at all.  Periodic jobs are
     fairly non-critical and nothing particularly bad will happen if
     they aren't run religiously every night, especially on a personal
     laptop where there's only one user to worry about and you aren't
     modifying the passwd and group files that often.  You can achieve
     the same results as the periodic scripts by other means where
     necessary -- occasionally running the scripts by hand works, and
     having comprehensive backups (which you should do in any case)
     will be sufficient to replace a number of the periodic jobs.

	Cheers,

	Matthew




--9ivsD019Hw0RoMluQVgGQRxF97GRvcPvb--

--s8Qqb6JRPiPgcQLsxsE4OI7L4r998HK8E
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJXklWpAAoJEABRPxDgqeTnweEQAI3d7tH2y9IMqo7ElyEeVeGp
lfvSXKSLPTYUAqQYz8/SoYZ9uEvqS9UsHxT/2v533g1wB7f0l7/dSPof2tSE8/3N
3HNKgV2V/rzLFknvrMInoEanDA4m6pJ/8BKKU2nL6nvkAeXR5PCFaHrVBfT5UuQm
kqWFSKVJCjIhgYu2NpzRyb8Z7WPgivBQRHJCJaODJkcrSN0L4AyLBWmU4+1btzzI
r2G8Yp8eh04s+qg4+E9Ms1m3kGPBkW3RcuowkxeyO5ikI72oW538MnbPcXAmC6HZ
lq9uxvu80kjNQRh+IL6dXR+7ydw3lmcIVgR/8QF0BjYKIjkAAQicnRh2iY2uKtNh
sdsLfduc1e4T3II8bEFLCmytNNe5u9mnV6WBBSoWkTk9AVWZrDIa8r2xAkJ1fBXR
Ui+iyuW04pzfT8g/QrMrLjSpaCigsVgbsB2k6vlyivTTKOm8eyWfQlZB2L7y6Jn9
xgeecB2mvs/gA2rZ49UVKTfY/mPjw+upFHbfwWBcdgcr9seXX1GliP0rHiLZ1CZ6
7WnPXwNJvj7ckIhOTN0yBeRadxiA1PY0KGdyJtdibZjEaqn6Gb7e+LrGxX2wf9fN
aXYhAgdJ7hyp0Ij+f6j1nkgZfUW9wOPhWE3zayx3VyIptdHYpR+pWMIsS3yy4WQR
i9ZcBRgeMw4Wb1vKU6r9
=8htl
-----END PGP SIGNATURE-----

--s8Qqb6JRPiPgcQLsxsE4OI7L4r998HK8E--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0542d31e-53c6-3951-bff5-c0fef5e98ab3>