From: geep on
Hi,
I want to run a cronjob once after booting.
For Vixie Cron I see documented a syntax for crontab like:
@reboot /path/to/command

I've tried it and it doesn't seem to work.

I don't see any mention of @reboot in the manpage for crontab
on my Slack 12.2 (dcron-2.3.3).

Over at the dillon's cron website http://www.jimpryor.net/linux/dcron.html
the documentation is for dcron-4.4, and the crontab manpage does mention
the @reboot syntax.

So, has anybody successfully used the @reboot syntax with dcron-2.3.3?
Slack 13.0 onwards use dcron-4.4.
Anybody know any reasons why I'd get problems if I just build it on
Slack 12.2 and do an upgradepkg?

Cheers,
Peter
From: geep on
On Mon, 07 Jun 2010 23:16:13 +0200, José Manuel Ga
rcía-Patos wrote:

>> I want to run a cronjob once after booting. For Vixie Cron I see
>> documented a syntax for crontab like: @reboot /path/to/command
>
> If I understood you correctly, using the rc.local script on /etc/rc.d/
> should do the trick. No need for cronjobs. Just put there whatever code
> you want to execute at reboot.

Hi, Unfortunately that doesn't solve my problem - I already tried it.
There is another problem behind all this.

I have a disk shared by Linux and Windows - it's formatted vfat.
If the vfat disk is automounted then all the files belong to root and it's
impossible to change the owner with chown.

So an easy solution was to have a user run a cronjob at boot time to
mount the disk. Then the files belong to that user.

If the mount is run by rc.local, then root is running the mount, and
the files end up owned by root.

I also tried running a mount command from the user's ~/kde/Autostart
This has the problem that it is too late. I have a Perl script which
lives on the vfat disk which runs every 20 seconds, started by crontab.
But crontab is trying to run the script before the vfat disk is mounted.
(The Perl script is on the vfat disk as I run the exact same script from
Windows - it monitors my ADSL modem performance).

I think that it might be possible to avoid running a command to
mount the vfat disk by using options in fstab - uid gid etc.
But I haven't yet figured the fstab options.
Any help with fstab options appreciated - I want to know fstab options
to mount a vfat diisk so that the files end up owned by a specic user.

Cheers,
Peter
From: Giovanni on
On 06/08/10 15:07, geep wrote:
> On Mon, 07 Jun 2010 23:16:13 +0200, José Manuel Ga
> rcía-Patos wrote:
>
>>> I want to run a cronjob once after booting. For Vixie Cron I see
>>> documented a syntax for crontab like: @reboot /path/to/command
>> If I understood you correctly, using the rc.local script on /etc/rc.d/
>> should do the trick. No need for cronjobs. Just put there whatever code
>> you want to execute at reboot.
>
> Hi, Unfortunately that doesn't solve my problem - I already tried it.
> There is another problem behind all this.
>
> I have a disk shared by Linux and Windows - it's formatted vfat.
> If the vfat disk is automounted then all the files belong to root and it's
> impossible to change the owner with chown.
>
> So an easy solution was to have a user run a cronjob at boot time to
> mount the disk. Then the files belong to that user.
>
> If the mount is run by rc.local, then root is running the mount, and
> the files end up owned by root.
>
> I also tried running a mount command from the user's ~/kde/Autostart
> This has the problem that it is too late. I have a Perl script which
> lives on the vfat disk which runs every 20 seconds, started by crontab.
> But crontab is trying to run the script before the vfat disk is mounted.
> (The Perl script is on the vfat disk as I run the exact same script from
> Windows - it monitors my ADSL modem performance).
>
> I think that it might be possible to avoid running a command to
> mount the vfat disk by using options in fstab - uid gid etc.
> But I haven't yet figured the fstab options.
> Any help with fstab options appreciated - I want to know fstab options
> to mount a vfat diisk so that the files end up owned by a specic user.

I have in my fstab this line:
/dev/hda5 /win/d vfat noexec,gid=users,umask=0002

but I think that you can put the mount command in rc.local:
mount -t vfat -o noexec,gid=users,umask=0002 /dev/hda5 /win/d

Ciao
Giovanni
--
A computer is like an air conditioner,
it stops working when you open Windows.
< http://giovanni.homelinux.net/ >
From: Eef Hartman on
geep <geep(a)boursomail.com> wrote:
> I have a disk shared by Linux and Windows - it's formatted vfat.
> If the vfat disk is automounted then all the files belong to root and it's
> impossible to change the owner with chown.

That is easy to change in the /etc/fstab file options FOR that mount:
e.g. uid=<that_users_id>,fmask=033,dmask=022
(makes all files owned by that UID, only writable FOR that uid and
normal files do NOT have the execute bit, directories DO).
--
******************************************************************
** Eef Hartman, Delft University of Technology, dept. SSC/ICT **
** e-mail: E.J.M.Hartman(a)tudelft.nl - phone: +31-15-27 82525 **
******************************************************************
From: Grant on
On Tue, 08 Jun 2010 15:37:08 +0200, Eef Hartman <E.J.M.Hartman(a)tudelft.nl> wrote:

>geep <geep(a)boursomail.com> wrote:
>> I have a disk shared by Linux and Windows - it's formatted vfat.
>> If the vfat disk is automounted then all the files belong to root and it's
>> impossible to change the owner with chown.
>
>That is easy to change in the /etc/fstab file options FOR that mount:
>e.g. uid=<that_users_id>,fmask=033,dmask=022
>(makes all files owned by that UID, only writable FOR that uid and
>normal files do NOT have the execute bit, directories DO).

How do the permissions work on vfat? The bits are not there, are they?

Grant.
--
http://bugs.id.au/
 |  Next  |  Last
Pages: 1 2
Prev: route command question
Next: Mplayer question/problem