Re: Running a command at startup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Wed, Dec 12, 2018 at 09:43:56PM -0500, Robert Moskowitz wrote:
> 
> OK....
> 
> I have had problems in the past with crontab parsing a command. Would I use:
> 
> @reboot root echo none | tee /sys/class/leds/blue\:heartbeat/trigger
> 
> ?
> 
> Or do I have to make a script and run that?

Since this is a crontab, you can use normal shell redirection:

@reboot root echo none > /sys/class/leds/blue\:heartbeat/trigger

in a file in /etc/cron.d/

The 'echo foo | sudo tee' thing is what you do for people who are
using sudo to echo output into a file -- so often people think they
can do 'sudo echo none > /some/path' and will be surprised it doesn't
work.

I still think it makes sense to create it as a systemd unit.

-- 
Jonathan Billings <billings@xxxxxxxxxx>
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]


  Powered by Linux