The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,822 other followers

Archive for the ‘*nix’ Category

OpenSuSE: location of cron jobs

Posted by jpluimers on 2020/01/20

When you look at how to find listed cron jobs, usually the answer is cron -l or cron -u username -l.

However, on OpenSuSE systems, cron jobs can be in different places, and the sysconfig settings have influence on them too.

These files and directories all influence cron:

Directories:

/etc/cron.d/
/etc/cron.daily/
/etc/cron.hourly/
/etc/cron.monthly/
/etc/cron.weekly/

Files:

/etc/sysconfig/cron
/etc/init.d/rc2.d/K01cron
/etc/init.d/rc2.d/S14cron
/etc/init.d/rc3.d/K01cron
/etc/init.d/rc3.d/S14cron
/etc/init.d/rc5.d/K01cron
/etc/init.d/rc5.d/S14cron
/etc/init.d/cron
/etc/news/crontab.sample
/etc/pam.d/crond
/etc/systemd/system/multi-user.target.wants/cron.service
/etc/omc/srvinfo.d/cron.xml
/etc/cron.deny
/etc/crontab

Most are available for other Linux distributions as well, but each one might have slightly different configurations (especially for the directories). Some background reading:

Some details:

  • The crontab -l will only list what is in /etc/crontab.
  • These directories are influenced by/etc/sysconfig/cron, especially the DAILY_TIME variable (see below) for the daily jobs.
    All of the directories are checked every 15 minutes through /usr/lib/cron/run-crons:/etc/cron.daily/
    /etc/cron.hourly/
    /etc/cron.monthly/
    /etc/cron.weekly/
  • That script then uses these files for checking when to run:/var/spool/cron/lastrun/cron.weekly
    /var/spool/cron/lastrun/cron.daily
    /var/spool/cron/lastrun/cron.hourly

The DAILY_TIME variable:

## Type: string
## Default: ""
#
# At which time cron.daily should start. Default is 15 minutes after booting
# the system. Example setting would be "14:00".
# Due to the fact that cron script runs only every 15 minutes,
# it will only run on xx:00, xx:15, xx:30, xx:45, not at the accurate time
# you set.
DAILY_TIME=""

–jeroen

 

Posted in *nix, *nix-tools, cron, Linux, openSuSE, Power User, SuSE Linux, Tumbleweed | Leave a Comment »

a perf cheat sheet from @brendangregg’s fantastic web page;  you can print it as PDF

Posted by jpluimers on 2020/01/13

From a while back: [WayBack⚡Julia Evans⚡ on Twitter : made a perf cheat sheet from @brendangregg’s fantastic https://t.co/SBDtzn0G8J. you can print it at https://t.co/xC6ndjrSDL https://t.co/TstbBBe3DS

References:

The latter has a lot of examples and even more explanation all around the below picture.

–jeroen

Read the rest of this entry »

Posted in *nix, *nix-tools, Development, Linux, Power User, Profiling-Performance-Measurement | Leave a Comment »

imagemagick – Command line convert webp to jpg? – Unix & Linux Stack Exchange

Posted by jpluimers on 2019/12/23

For my link archive: [WayBack] imagemagick – Command line convert webp to jpg? – Unix & Linux Stack Exchange

–jeroen

Posted in *nix, *nix-tools, Google, GoogleWebP, Image Editing, Power User, The Gimp | Leave a Comment »

Magic SysRq key – Wikipedia

Posted by jpluimers on 2019/12/20

Cool: Magic SysRq key – Wikipedia

The magic SysRq key is a key combination understood by the Linux kernel, which allows the user to perform various low-level commands regardless of the system’s state. It is often used to recover from freezes, or to reboot a computer without corrupting the filesystem.[1] Its effect is similar to the computer’s hardware reset button (or power switch) but with many more options and much more control.

Sometimes reading fluffy fluff posts teaches you new things, so be sure to read this one:

[WayBack] I just got trolled by my cat, hard. Last night i left my linux laptop open and running while watching TV in the other room. I came back to find Marley … – Stephen Shirley – Google+

I started looking through the kernel logs from last night, to see if there was any indication of the issue starting. And then i saw it. One innocent line that said:

Dec 18 21:26:52 x240 kernel: [373001.156356] sysrq: SysRq : Emergency Remount R/O

The fluffy dumbass had somehow hit the Sysrq [0] key combo to mount all filesystems read-only. This is an old, low-level when-all-else-fails facility for dealing with an linux unresponsive system, and fluff-for-brains Marley had somehow hit alt+fn+s+u.

Sigh.

[0] https://en.wikipedia.org/wiki/Magic_SysRq_key

Via: [Archive.is] I just got trolled by my cat, hard. Last night i left my linux laptop open and running while watching TV in the other room. I came back to find Marley … – Kristian Köhntopp – Google+

–jeroen

Posted in *nix, *nix-tools, Keyboards and Keyboard Shortcuts, Linux, Power User | Leave a Comment »

CHMOD – Applying Different Permissions For Files vs. Directories – Server Fault

Posted by jpluimers on 2019/12/16

The answers at [WayBackCHMOD – Applying Different Permissions For Files vs. Directories – Server Fault describe various ways to do this. Depending in why/when you want to change them you’d probably favour different ones, so be sure to read the answers.

I mostly use these combinations:

find . -type d -exec chmod 700 {} \;
find . -type f -exec chmod 600 {} \;

and

find . -type d -exec chmod 775 {} \;
find . -type f -exec chmod 664 {} \;

And since I forget how to do ocatal too often:

commonly used permissions:

Permission COMMAND
---------   ------------------
rwxrwxrwx   chmod 777 filename
rwxrwxr-x   chmod 775 filename
rwxr-xr-x   chmod 755 filename
rw-rw-rw-   chmod 666 filename
rw-rw-r--   chmod 664 filename
rw-r--r--   chmod 644 filename

permissions are divided into 3 divisions. The first rwx is for the owner. The next 3 is for the group. The last 3 is for everyone else.

rwx------  owner permissions - read, write, executable
---rwx---   group permissions - rwx
------rwx   other permissions - rwx

Source: [WayBackTitle

–jeroen

Posted in *nix, Power User | Leave a Comment »

 
%d bloggers like this: