GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Miakoda (hellomiakoda@pdx.social)'s status on Sunday, 19-Oct-2025 10:40:22 JST Miakoda Miakoda

    #Linux question - 2 parts. Distro: OpenSuse

    1 - I'm not sure my scripts in /etc/cron.hourly\daily\monthly are being run. Is there something I'm supposed to do to enable that? Yes, they have executable permissions, and the scripts run without error if I manually run them (ie # bash /etc/cron.<time>/<script> )

    2 - Suggestions on a way to be notified when a script is run? Machine in question is no-gui, a server.
    I don't care if it's a notification on my other Linux machines on lan, or an IM

    In conversation about 9 months ago from pdx.social permalink
    • Embed this notice
      Miakoda (hellomiakoda@pdx.social)'s status on Sunday, 19-Oct-2025 10:43:25 JST Miakoda Miakoda
      in reply to

      2 (continued) - I'd even be fine if it was some sort of message I see when I log in to the server over ssh. Maybe there's a way to do it via kconnect, but I don't know of a way without a GUI. Telegram? Matrix? XMPP? Email would work, if that's my only option, but it's not idea.
      Hell, a Home Assistant trigger would work!
      Just ANYTHING to know if the script ran at the time it was supposed to run.
      I need to rule out my scripts being shit. They work when manually run, but I want to be CERTAIN!

      In conversation about 9 months ago permalink
    • Embed this notice
      Miakoda (hellomiakoda@pdx.social)'s status on Sunday, 19-Oct-2025 10:46:31 JST Miakoda Miakoda
      in reply to

      One of the scripts, I went as far as having Home Assistant log in to that server via ssh and run the script, putting that on an automation. That''s... not ideal. I'd much rather cron.<time> just do it.

      In conversation about 9 months ago permalink
    • Embed this notice
      Miakoda (hellomiakoda@pdx.social)'s status on Sunday, 19-Oct-2025 11:10:55 JST Miakoda Miakoda
      in reply to
      • James Wells

      @nikatjef

      #! /bin/bash

      In conversation about 9 months ago permalink
    • Embed this notice
      James Wells (nikatjef@mastodon.acm.org)'s status on Sunday, 19-Oct-2025 11:10:56 JST James Wells James Wells
      in reply to

      @hellomiakoda
      1. What is the shebang for your scripts. I ask because many versions of cron default on restrictive paths and may not find your executor if you don't fully qualify the filename
      2. I often use "/use/bin/env logger 'Made it to stage: X'" where X is a step number. That will get written to your system log or journal

      In conversation about 9 months ago permalink
    • Embed this notice
      Miakoda (hellomiakoda@pdx.social)'s status on Sunday, 19-Oct-2025 11:17:29 JST Miakoda Miakoda
      in reply to
      • James Wells

      @nikatjef My shebangs are a..
      #! /bin/bash
      ...and I just double checked to make sure there IS bash in /bin. Yes.
      Just to be extra sure.

      In conversation about 9 months ago permalink
    • Embed this notice
      James Wells (nikatjef@mastodon.acm.org)'s status on Sunday, 19-Oct-2025 11:17:31 JST James Wells James Wells
      in reply to

      @hellomiakoda
      A simple test would be something like the following in /etc/cron.hourly;
      #!/usr/bin/env bash
      /usr/bin/env logger "running: $@"

      Then check, /etc/crontab to see what time cron.hourly runs and watch your system log around that time

      In conversation about 9 months ago permalink
    • Embed this notice
      James Wells (nikatjef@mastodon.acm.org)'s status on Sunday, 19-Oct-2025 11:17:31 JST James Wells James Wells
      in reply to

      @hellomiakoda
      Just in case you are unaware of the shebang line, I use env to call the first bash entry in the path, which is usually /bin/bash, but not always.

      In conversation about 9 months ago permalink
    • Embed this notice
      Miakoda (hellomiakoda@pdx.social)'s status on Sunday, 19-Oct-2025 11:27:07 JST Miakoda Miakoda
      in reply to
      • James Wells

      @nikatjef It's supposed to be #!/bin/bash ?

      In conversation about 9 months ago permalink
    • Embed this notice
      James Wells (nikatjef@mastodon.acm.org)'s status on Sunday, 19-Oct-2025 11:27:08 JST James Wells James Wells
      in reply to

      @hellomiakoda
      You are showing a space between the ! and / IIRC that is breaks it

      In conversation about 9 months ago permalink
    • Embed this notice
      Miakoda (hellomiakoda@pdx.social)'s status on Sunday, 19-Oct-2025 11:27:32 JST Miakoda Miakoda
      in reply to
      • James Wells

      @nikatjef I just went and looked it up... Well, fuck me. I apparently have had that wrong for years. I'll go make some corrections and see if things work better

      In conversation about 9 months ago permalink
    • Embed this notice
      Miakoda (hellomiakoda@pdx.social)'s status on Sunday, 19-Oct-2025 11:54:23 JST Miakoda Miakoda
      in reply to
      • James Wells

      @nikatjef Yeah, I knew cron doesn't have a shell... but I never even thought to consider that running a script myself would work even if I got the shebang wrong.
      ALL my scripts had that space, cause I thought it belonged there. I just fixed all the scripts in cron on my server... hopefully I remember to go back in and fix the copies not in cron, along with scripts not currently being used.

      In conversation about 9 months ago permalink
    • Embed this notice
      James Wells (nikatjef@mastodon.acm.org)'s status on Sunday, 19-Oct-2025 11:54:24 JST James Wells James Wells
      in reply to

      @hellomiakoda
      Not sure if that is the issue, but when you log into the box, you get a shell, and if the shebang is broken or missing, your existing shell will be used. Cron doesn't have a shell, it would not be able to run the script.

      In conversation about 9 months ago permalink
    • Embed this notice
      Miakoda (hellomiakoda@pdx.social)'s status on Sunday, 19-Oct-2025 11:55:13 JST Miakoda Miakoda
      in reply to
      • James Wells

      @nikatjef I just disabled the HA automation that was triggering that one script over ssh, so now only cron is set to kick it off. That one should be pretty noticeable in the next day or two to know if it ran.

      In conversation about 9 months ago permalink
    • Embed this notice
      Miakoda (hellomiakoda@pdx.social)'s status on Sunday, 19-Oct-2025 11:56:43 JST Miakoda Miakoda
      in reply to
      • James Wells

      @nikatjef Thanks for noticing that goof

      In conversation about 9 months ago permalink
    • Embed this notice
      James Wells (nikatjef@mastodon.acm.org)'s status on Sunday, 19-Oct-2025 11:56:44 JST James Wells James Wells
      in reply to

      @hellomiakoda
      Hope it solved your issue. G'luck

      In conversation about 9 months ago permalink
    • Embed this notice
      Josh Rivers (joshrivers@techhub.social)'s status on Monday, 20-Oct-2025 05:58:18 JST Josh Rivers Josh Rivers
      in reply to

      @hellomiakoda If you have an MTA set up cron should be delivering errors and scrip output via email.

      If you don’t, I’d think that the information should be in /var/spool/mail and you can use less or pine or something to scan it.

      In conversation about 9 months ago permalink
    • Embed this notice
      Miakoda (hellomiakoda@pdx.social)'s status on Monday, 20-Oct-2025 05:58:18 JST Miakoda Miakoda
      in reply to
      • Josh Rivers

      @joshrivers Wait what's mta?

      In conversation about 9 months ago permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.