• Re: [gentoo-user] cronie setup questions

    From Walter Dnes@21:1/5 to Walter Dnes on Wed Oct 9 17:40:01 2024
    On Thu, Oct 03, 2024 at 07:47:34PM -0400, Walter Dnes wrote
    The Gentoo install suggested using "cronie". I want to run a script
    daily as local user. The config I want is...

    35 7 * * * waltdnes /home/waltdnes/pm/check4update/check4update

    My email shows that the job is launching, but tripping over
    permissions. Here's what it's supposed to do...

    * Because I'm running a custom build of Pale Moon web browser, I can't
    use the built-in updater from the standard version
    * I want to check the palemoon.org Atom feed for new releases
    * A text file "previous.txt" has the date stamp of the most recent entry
    * bash script "check4update"...
    *** wget's the webpage
    *** greps the "<published>" lines
    *** the top line has the most recent posting
    *** compare the the most recent <published> date with "previous.txt"
    *** if the same, exit
    *** if not the same...
    *** 1) update "previous.txt" with the newest date
    *** 2) use "geeqie" to display a garish messege about the update

    That last step is the problem. I get the following error...

    (geeqie:14531): Gtk-WARNING **: 07:35:01.797: cannot open display:

    What do I need to do to allow "geeqie" to open up in an X window as
    user "waltdnes".

    --
    There are 2 types of people in this world
    1) Those who can extrapolate from incomplete data

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Wed Oct 9 17:45:47 2024
    On Wednesday 9 October 2024 16:31:16 BST Walter Dnes wrote:
    On Thu, Oct 03, 2024 at 07:47:34PM -0400, Walter Dnes wrote

    The Gentoo install suggested using "cronie". I want to run a script

    daily as local user. The config I want is...

    35 7 * * * waltdnes /home/waltdnes/pm/check4update/check4update

    My email shows that the job is launching, but tripping over
    permissions. Here's what it's supposed to do...

    * Because I'm running a custom build of Pale Moon web browser, I can't
    use the built-in updater from the standard version
    * I want to check the palemoon.org Atom feed for new releases
    * A text file "previous.txt" has the date stamp of the most recent entry
    * bash script "check4update"...
    *** wget's the webpage
    *** greps the "<published>" lines
    *** the top line has the most recent posting
    *** compare the the most recent <published> date with "previous.txt"
    *** if the same, exit
    *** if not the same...
    *** 1) update "previous.txt" with the newest date
    *** 2) use "geeqie" to display a garish messege about the update

    That last step is the problem. I get the following error...

    (geeqie:14531): Gtk-WARNING **: 07:35:01.797: cannot open display:

    What do I need to do to allow "geeqie" to open up in an X window as
    user "waltdnes".

    You could let it know which display to use in your script, something like:

    export DISPLAY=:0

    However, it gets more complicated if a user is not logged in whenever the script happens to run and if the display is on :1 or some other value. You would probably need to fish for $DISPLAY using awk or something similar and feed this into your script before your '/usr/bin/geeqie %u'. Someone more knowledgable on scripting languages will hopefully advise.
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmcGszsACgkQseqq9sKV ZxknXg/7B+I0iF32eX/qQiKzw+ekzrC+doPNHSxjXku2XnzzYCko1fJ/D/Zn7m7P SgirSrmS6XqJWK8cBEo6hlUQErdVT1ZcUJhrl2mwn4krGPdR39vDgoD6gvv4H9pA oO6ZNHfyEv9+wypFbVV130AB5iFA3mXSgOC/mvZUxrS8rlKbpfl6s7MFNH+yaZ8y chP/lC8kU7CWOOL/MOVKE/l7F5+dWigMsRamW1wavG6ryvXv4N7Q2J7twX4FLPOK giwctbtkU46BNqO/8Jx/OMZVky7+KOJ/MDDjdkpDUok1/SecvvbMVCfW93xAvBxa 61A9OSxm2IiJgTjy3l7kZdYg/NoQyWf8ALQBmsPlUNGrHMSaQEobbSCjXe5b9V4F 2F/36bDe1jZNpxGw7vsW3u1R5xHiJnyytdDq3a7MJ1scOLjzwOLyt1t/BKyGYs6B RcUYPuHjU3wpdVIRtVPQBXyckO4It7vUVo6GPfbNdl/BYF8rU2/goO/PU43oKtL1 Dtcc/dcefPb/2+0XK7U/d5MHJUdhILVxVwFLBfsfCFxGY70TEiJbXuoArynEMgaG iVwMSKO8XBB8yGRxm5cDXdcQ3BfZOFMZZam4ttBljz5a3HpfK0EWo5dDHwrJNLer CZDcjNXrzQ/Wa4m+ds4IzBHmQ2slyrjTqGLJpMSjXffI8F2ahxk=
    =67v5
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Walter Dnes@21:1/5 to All on Fri Oct 4 01:50:01 2024
    The Gentoo install suggested using "cronie". I want to run a script
    daily as local user. The config I want is...

    35 7 * * * waltdnes /home/waltdnes/pm/check4update/check4update

    I did some RTFM...

    * There is no "man cronie" but there is a /etc/init.d/cronie
    * There is a "man cron"
    * There is a "crond" and an "anacron"
    * There is "/etc/crontab" and "/etc/anacrontab"

    My head hurts. Which config file do I enter the config into, and are
    there any initialization steps? Is there a simpler cron program, if
    that would help?

    --
    There are 2 types of people
    1) Those who can extrapolate from incomplete data

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)