Re: Cron not executing @reboot command in crontab

2019-11-17 Thread Unicorn
> At the top of the file you'll see:
> 
>   PATH=/bin:/sbin:/usr/bin:/usr/sbin
> 
> Either {pre,ap}pend /usr/local/{,s}bin or use the full command path.
> 
> Regards,
> 
> Raf
> 

> Use a full path. cran has a very limited default PATH.
>
>   -Otto


Thank you both, it works perfectly now!

Best,

Unicorn



Re: Cron not executing @reboot command in crontab

2019-11-17 Thread Raf Czlonka
On Sun, Nov 17, 2019 at 11:57:44AM GMT, Unicorn wrote:
> Hello,
> 
> I apologize if this is trivial, I genuinely read through all the cron-
> related manpages and tried several things, but this is my issue:
> 
> I want to use 'autossh' to automatically establish reverse port
> forwarding on boot, so (as root) I can 'crontab -e' and added this line
> to the bottom:
> 
> @reboot autossh [all my options]
> 
> After adding the line, running 'crontab -l' shows that the line was
> correctly added; I have also confirmed that the 'autossh ...' part
> works perfectly when I just execute it in a terminal. When I reboot the
> system though, nothing happens.
> 
> Even if I restart cron with rcctl, nothing happens. I even confirmed
> that sshd is started before cron in rc, I have tried everything I could
> come up with, I just have no clue what I'm missing.
> 
> Since I am new to OpenBSD, I would appreciate your advice or any clues
> on what I have done wrong. Regarding system setup, this is a completely
> bare system, I have just run 'sysupgrade -s' and installed autossh.
> 
> Thank you in advance!
> 

At the top of the file you'll see:

PATH=/bin:/sbin:/usr/bin:/usr/sbin

Either {pre,ap}pend /usr/local/{,s}bin or use the full command path.

Regards,

Raf



Re: Cron not executing @reboot command in crontab

2019-11-17 Thread Otto Moerbeek
On Sun, Nov 17, 2019 at 12:57:44PM +0100, Unicorn wrote:

> Hello,
> 
> I apologize if this is trivial, I genuinely read through all the cron-
> related manpages and tried several things, but this is my issue:
> 
> I want to use 'autossh' to automatically establish reverse port
> forwarding on boot, so (as root) I can 'crontab -e' and added this line
> to the bottom:
> 
> @reboot autossh [all my options]
> 
> After adding the line, running 'crontab -l' shows that the line was
> correctly added; I have also confirmed that the 'autossh ...' part
> works perfectly when I just execute it in a terminal. When I reboot the
> system though, nothing happens.
> 
> Even if I restart cron with rcctl, nothing happens. I even confirmed
> that sshd is started before cron in rc, I have tried everything I could
> come up with, I just have no clue what I'm missing.
> 
> Since I am new to OpenBSD, I would appreciate your advice or any clues
> on what I have done wrong. Regarding system setup, this is a completely
> bare system, I have just run 'sysupgrade -s' and installed autossh.
> 
> Thank you in advance!
> 

Use a full path. cran has a very limited default PATH.

-Otto



Cron not executing @reboot command in crontab

2019-11-17 Thread Unicorn
Hello,

I apologize if this is trivial, I genuinely read through all the cron-
related manpages and tried several things, but this is my issue:

I want to use 'autossh' to automatically establish reverse port
forwarding on boot, so (as root) I can 'crontab -e' and added this line
to the bottom:

@reboot autossh [all my options]

After adding the line, running 'crontab -l' shows that the line was
correctly added; I have also confirmed that the 'autossh ...' part
works perfectly when I just execute it in a terminal. When I reboot the
system though, nothing happens.

Even if I restart cron with rcctl, nothing happens. I even confirmed
that sshd is started before cron in rc, I have tried everything I could
come up with, I just have no clue what I'm missing.

Since I am new to OpenBSD, I would appreciate your advice or any clues
on what I have done wrong. Regarding system setup, this is a completely
bare system, I have just run 'sysupgrade -s' and installed autossh.

Thank you in advance!