9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "有澤 健治" <karisawa@gmail.com>
To: 9fans@9fans.net
Subject: [9fans] cron job
Date: Sun, 5 Sep 2021 16:52:53 +0900	[thread overview]
Message-ID: <d4c5343f-956b-7f07-fa27-b1080837fb41@gmail.com> (raw)

Hello all,

I noticed what I donn't understand.


Let alice be a user of a system hebe,
and try an experiment on cron job.

STEP 1.
make /usr/alice/tmp/T that looks like:
hebe# ls -dl /usr/alice/tmp/T
d-rwxrwxrwx M 24 alice alice 0 Sep  3 01:00 /usr/alice/tmp/T
hebe#

STEP 2.
make a rc script /usr/alice/bin/rc/touchtest:
#!/bin/rc
rfork e
d=/usr/alice/tmp/T
t=`{date -n}
touch $d/$t

STEP 3.
make a cron job for alice on /cron/alice/cron such that:
0,10,20,30,40,50 * * * * local /usr/alice/bin/rc/touchtest

STEP 4.
observe files in /usr/alice/tmp/T
and you can confirm, owner of created files is hostowner, not alice.
my case:
hebe% cd /usr/alice/tmp
hebe% ls -l T
--rw-rw-rw- M 195329 arisawa alice 0 Sep  3 00:40 T/1630597201
--rw-rw-rw- M 195329 arisawa alice 0 Sep  3 00:50 T/1630597801
--rw-rw-rw- M 195329 arisawa alice 0 Sep  3 01:00 T/1630598401
hebe%

where "arisawa" is the hostowner of "hebe".
Is this reasonable ?

additional info:
hebe# ps | grep cron
arisawa         366    0:00   0:00      128K Sleep    cron
hebe#

Kenji Arisawa


------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/Ta5081ae14eab6746-M34fbc30045c26c5432a036f6
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

             reply	other threads:[~2021-09-05  7:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-05  7:52 有澤 健治 [this message]
2021-09-05 11:20 ` [9fans] " 有澤 健治

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d4c5343f-956b-7f07-fa27-b1080837fb41@gmail.com \
    --to=karisawa@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).