You are not logged in.
Pages: 1
I wanted to know how to do so and also, how to do so with command line arguments.
Like this for example:
xset dpms noblank on
ONLY, added to whatever crontab I want.
The one I actually want added is this though, for root:
tblock -Syu
Aka, I want tblock to update my /etc/hosts every time I log in and after that, every hour.
Thoughts?
Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Peace Be With us All!
Offline
For every hour, you could put a script in /etc/cron.hourly.
For running something upon login, you would probably put it in some file that gets sourced at login or in your desktop's startup apps. (e.g. .bashrc, .profile, .xsettings, or other. I'm not sure what's most appropriate.)
For running something when you boot up, you could put commands in /etc/rc.local.
Online
For every hour, you could put a script in /etc/cron.hourly.
For running something upon login, you would probably put it in some file that gets sourced at login or in your desktop's startup apps. (e.g. .bashrc, .profile, .xsettings, or other. I'm not sure what's most appropriate.)
For running something when you boot up, you could put commands in /etc/rc.local.
Would it have root permissions? If so, that would suffice.
Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Peace Be With us All!
Offline
The scripts in /etc/cron.* and /etc/rc.local will run as root. Any that you set in your desktop startup apps will run as your user.
Online
The scripts in /etc/cron.* and /etc/rc.local will run as root. Any that you set in your desktop startup apps will run as your user.
Hmm... okay, just one thing comes to mind though, how would this work in openrc?
I cannot find /etc/rc.local and I am not completely sure what a script is supposed to look like when it is set to do a command.
I ask because, isn't /etc/rc.local a sysvinit function?
Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Peace Be With us All!
Offline
I ask because, isn't /etc/rc.local a sysvinit function?
IIRC, openrc uses the sysvinit scripts.
Offline
/etc/rc.local belongs to initscripts which according to its dependencies are used the same in sysv-rc | file-rc | openrc.
So, no, it's not a sysvinit function.
I suppose there is always the question of which belongs to what, and in particular, which part of the OS belongs to "the init system". When asked, different people answers different things about that. Perhaps the most strict view about sysvinit would be to say that it consists only of the binaries of sysvinit-core and the configuration file /etc/inittab, and then anything below that is "run control", start up code or daemons.
And then perhaps an opposite "init is everything" may also be peddled, as well as any concept granularity in between.
Offline
Now there's an answer!
Offline
/etc/rc.local belongs to initscripts which according to its dependencies are used the same in sysv-rc | file-rc | openrc.
So, no, it's not a sysvinit function.
I suppose there is always the question of which belongs to what, and in particular, which part of the OS belongs to "the init system". When asked, different people answers different things about that. Perhaps the most strict view about sysvinit would be to say that it consists only of the binaries of sysvinit-core and the configuration file /etc/inittab, and then anything below that is "run control", start up code or daemons.
And then perhaps an opposite "init is everything" may also be peddled, as well as any concept granularity in between.
Hmm... the peculiar thing is... I don't have an rc.local.
I have something like this:
a readme is here:
/usr/share/openrc/support/sysvinit/README.md
says the below:
Here's a sample inittab for use with sysvinit for Linux based systems.
We don't install it by default as sysvinit packages normally own this file.
Anywho, isn't there an example of what it is supposed to look like when it is being used?
I suppose I could check other unixlike systems to see what they look like when cron is being used.
Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Peace Be With us All!
Offline
/etc/rc.local is an executable script (or program) that gets exec'd by e.g., the /etc/init.d/rc.local startup script.
/etc/inittab is a configuration file for sysvinit's init program, and it is not a script, but rather a series of service declarations that are interpreted by /sbin/init. When man pages were a thing you would have "man inittab" as way of finding out its syntax.
Offline
/etc/rc.local is an executable script (or program) that gets exec'd by e.g., the /etc/init.d/rc.local startup script.
/etc/inittab is a configuration file for sysvinit's init program, and it is not a script, but rather a series of service declarations that are interpreted by /sbin/init. When man pages were a thing you would have "man inittab" as way of finding out its syntax.
Hmm.. if I understand then correctly, all I need to do is put it in the hourly folder and set it up like a cron file and it should work, right?
wanting to make a system type one where you add parameters at the end as I said above, I think?
tblock -Syu
Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Peace Be With us All!
Offline
Possibly yes; cron typically executes scripts and programs in /etc/cron.hourly according to the line saying so in /etc/crontab.
See also the note about PATH in man 5 crontab.
Offline
Possibly yes; cron typically executes scripts and programs in /etc/cron.hourly according to the line saying so in /etc/crontab.
See also the note about PATH in man 5 crontab.
Couldn't figure out how to start this, dunno why.
*sigh*
But no worries, the developer of tblock actually is trying to debloat his package so it won't slow everything down to a crawl.
Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Peace Be With us All!
Offline
Pages: 1