Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Your own mileage may vary.


computers / alt.os.linux.mint / Re: Crontab Question [Solved]

SubjectAuthor
* Crontab QuestionBig Al
+* Re: Crontab Question [Solved]Big Al
|`* Re: Crontab Question [Solved]Dan Purgert
| +* Re: Crontab Question [Solved]Chris Elvidge
| |`- Re: Crontab Question [Solved]Dan Purgert
| `- Re: Crontab Question [Solved]Big Al
`- Re: Crontab QuestionJack Strangio

1
Crontab Question

<un6b80$3llru$1@dont-email.me>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7370&group=alt.os.linux.mint#7370

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ala...@invalid.com (Big Al)
Newsgroups: alt.os.linux.mint
Subject: Crontab Question
Date: Thu, 4 Jan 2024 08:18:56 -0500
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <un6b80$3llru$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 4 Jan 2024 13:18:56 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f49782b4c2ea60324d9f0a69ac89b573";
logging-data="3856254"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1//ggSYmhroAns/YE+uCvu82DsYlNpkW0w="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:/+fomhseOrDaeiJnbLVhH+Xw/K0=
Content-Language: en-US
 by: Big Al - Thu, 4 Jan 2024 13:18 UTC

I have a shell script I can run manually that produces sounds, small pops sound, as it is running to let me know what
stage of the program it's in. Works great running it from a launcher or opening my bin folder to run it.

I put it in cron and it runs too, but the sounds don't work. The tail end creates a notification that pops up either
way I run it, but it's just the sounds that don't work as cron.

I created it via crontab -e. As me the user not root of course.
Any ideas.
--
Linux Mint 21.2 Cinnamon
Al

Re: Crontab Question [Solved]

<un6c4m$3lqb6$1@dont-email.me>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7371&group=alt.os.linux.mint#7371

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ala...@invalid.com (Big Al)
Newsgroups: alt.os.linux.mint
Subject: Re: Crontab Question [Solved]
Date: Thu, 4 Jan 2024 08:34:14 -0500
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <un6c4m$3lqb6$1@dont-email.me>
References: <un6b80$3llru$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 4 Jan 2024 13:34:15 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f49782b4c2ea60324d9f0a69ac89b573";
logging-data="3860838"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ynr2qPxnPnPXCND1/Lol0K5pr9RzSs8k="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:MTFJflYEsZCe+FAzd/BFtKssog4=
Content-Language: en-US
In-Reply-To: <un6b80$3llru$1@dont-email.me>
 by: Big Al - Thu, 4 Jan 2024 13:34 UTC

On 1/4/24 08:18 AM, Big Al wrote:
> I have a shell script I can run manually that produces sounds, small pops sound, as it is running to let me know what
> stage of the program it's in.    Works great running it from a launcher or opening my bin folder to run it.
>
> I put it in cron and it runs too, but the sounds don't work.  The tail end creates a notification that pops up either
> way I run it, but it's just the sounds that don't work as cron.
>
> I created it via crontab -e.  As me the user not root of course.
> Any ideas.
Found it, and this happens so often. One last google and I type the right query.

export XDG_RUNTIME_DIR="/run/user/1000"
Needs to be put in the shell script. I'm not good enough to know why but evidently cron has no idea of my working
environment and this line gives it the needed config to be able to direct sound to my audio properly.

Hey, thanks for reading anyway. :-)
--
Linux Mint 21.2 Cinnamon
Al

Re: Crontab Question [Solved]

<slrnupdg6k.clb.dan@djph.net>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7372&group=alt.os.linux.mint#7372

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dan...@djph.net (Dan Purgert)
Newsgroups: alt.os.linux.mint
Subject: Re: Crontab Question [Solved]
Date: Thu, 4 Jan 2024 14:27:52 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <slrnupdg6k.clb.dan@djph.net>
References: <un6b80$3llru$1@dont-email.me> <un6c4m$3lqb6$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 4 Jan 2024 14:27:52 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="053b361a9bfd88cf78e0cc0b0ab9ee52";
logging-data="3876252"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18V/jnLrQEMeFMDJaFX+8aWzAO/mD8K+z0="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:hHeXU3My0/Ot5zpZ133i4Os5PL8=
 by: Dan Purgert - Thu, 4 Jan 2024 14:27 UTC

On 2024-01-04, Big Al wrote:
> On 1/4/24 08:18 AM, Big Al wrote:
>> I have a shell script I can run manually that produces sounds, small
>> pops sound, as it is running to let me know what stage of the program
>> it's in.    Works great running it from a launcher or opening my bin
>> folder to run it.
>>
>> I put it in cron and it runs too, but the sounds don't work.  The
>> tail end creates a notification that pops up either way I run it, but
>> it's just the sounds that don't work as cron.
>>
>> I created it via crontab -e.  As me the user not root of course.
>> Any ideas.
> Found it, and this happens so often. One last google and I type the
> right query.
>
> export XDG_RUNTIME_DIR="/run/user/1000"
> Needs to be put in the shell script. I'm not good enough to know why
> but evidently cron has no idea of my working environment and this line
> gives it the needed config to be able to direct sound to my audio
> properly.

This is because cron doesn't act as a logon session (or is it
"interactive" session ... ?) so things that're set in your environment
via .profile (.bash_profile, .bashrc, and so on) aren't available to the
job when launched via cron "by default".

I'm kinda interested to hear what the XDG_RUNTIME_DIR had to do with
playing sounds as well. Was it really that the sound wouldn't play, or
was something else happening? For example, you couldn't read some other
file that triggered "which sound"?

--
|_|O|_|
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: DDAB 23FB 19FA 7D85 1CC1 E067 6D65 70E5 4CE7 2860

Re: Crontab Question [Solved]

<un6hi5$3mjpb$1@dont-email.me>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7373&group=alt.os.linux.mint#7373

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chr...@mshome.net (Chris Elvidge)
Newsgroups: alt.os.linux.mint
Subject: Re: Crontab Question [Solved]
Date: Thu, 4 Jan 2024 15:06:43 +0000
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <un6hi5$3mjpb$1@dont-email.me>
References: <un6b80$3llru$1@dont-email.me> <un6c4m$3lqb6$1@dont-email.me>
<slrnupdg6k.clb.dan@djph.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 4 Jan 2024 15:06:45 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="832a66cdceeb711f192421138f049d3f";
logging-data="3886891"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18UmyBqUUpehA5AptFYNx5grxKxED/BYsQ="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
Thunderbird/52.2.1 Lightning/5.4
Cancel-Lock: sha1:CFlNEesfIxhD+hxG7nzM/yHMWFc=
Content-Language: en-GB
In-Reply-To: <slrnupdg6k.clb.dan@djph.net>
 by: Chris Elvidge - Thu, 4 Jan 2024 15:06 UTC

On 04/01/2024 14:27, Dan Purgert wrote:
> On 2024-01-04, Big Al wrote:
>> On 1/4/24 08:18 AM, Big Al wrote:
>>> I have a shell script I can run manually that produces sounds, small
>>> pops sound, as it is running to let me know what stage of the program
>>> it's in. Works great running it from a launcher or opening my bin
>>> folder to run it.
>>>
>>> I put it in cron and it runs too, but the sounds don't work. The
>>> tail end creates a notification that pops up either way I run it, but
>>> it's just the sounds that don't work as cron.
>>>
>>> I created it via crontab -e. As me the user not root of course.
>>> Any ideas.
>> Found it, and this happens so often. One last google and I type the
>> right query.
>>
>> export XDG_RUNTIME_DIR="/run/user/1000"
>> Needs to be put in the shell script. I'm not good enough to know why
>> but evidently cron has no idea of my working environment and this line
>> gives it the needed config to be able to direct sound to my audio
>> properly.
>
> This is because cron doesn't act as a logon session (or is it
> "interactive" session ... ?) so things that're set in your environment
> via .profile (.bash_profile, .bashrc, and so on) aren't available to the
> job when launched via cron "by default".
>
> I'm kinda interested to hear what the XDG_RUNTIME_DIR had to do with
> playing sounds as well. Was it really that the sound wouldn't play, or
> was something else happening? For example, you couldn't read some other
> file that triggered "which sound"?
>

I have a shell script that uses vlc to play various radio/media from the
command line via my bluetooth soundbar.

When I tried to prepare a home-grown suite that uses the same vlc to
play media from disk via a web interface (produced from shell scripts) I
found had to add XDG_RUNTIME_DIR and PULSE_COOKIE directives to get the
sound out through the soundbar.

Unfortunately, I can't remember where I got the idea from. But it works.

--
Chris Elvidge, England
I WILL NOT BELCH THE NATIONAL ANTHEM

Re: Crontab Question [Solved]

<slrnupdjks.clb.dan@djph.net>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7374&group=alt.os.linux.mint#7374

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dan...@djph.net (Dan Purgert)
Newsgroups: alt.os.linux.mint
Subject: Re: Crontab Question [Solved]
Date: Thu, 4 Jan 2024 15:26:40 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <slrnupdjks.clb.dan@djph.net>
References: <un6b80$3llru$1@dont-email.me> <un6c4m$3lqb6$1@dont-email.me>
<slrnupdg6k.clb.dan@djph.net> <un6hi5$3mjpb$1@dont-email.me>
Injection-Date: Thu, 4 Jan 2024 15:26:40 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="053b361a9bfd88cf78e0cc0b0ab9ee52";
logging-data="3891072"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19JMl9FuArc6GGL7Ay2KHavfjxolqHrO3k="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:oO2STfKXMfFHGfUk9yFH9YBLI8s=
 by: Dan Purgert - Thu, 4 Jan 2024 15:26 UTC

On 2024-01-04, Chris Elvidge wrote:
> On 04/01/2024 14:27, Dan Purgert wrote:
>> On 2024-01-04, Big Al wrote:
>>> On 1/4/24 08:18 AM, Big Al wrote:
>>>> I have a shell script I can run manually that produces sounds, small
>>>> pops sound, as it is running to let me know what stage of the program
>>>> it's in. Works great running it from a launcher or opening my bin
>>>> folder to run it.
>>>>
>>>> I put it in cron and it runs too, but the sounds don't work. The
>>>> tail end creates a notification that pops up either way I run it, but
>>>> it's just the sounds that don't work as cron.
>>>>
>>>> I created it via crontab -e. As me the user not root of course.
>>>> Any ideas.
>>> Found it, and this happens so often. One last google and I type the
>>> right query.
>>>
>>> export XDG_RUNTIME_DIR="/run/user/1000"
>>> Needs to be put in the shell script. I'm not good enough to know why
>>> but evidently cron has no idea of my working environment and this line
>>> gives it the needed config to be able to direct sound to my audio
>>> properly.
>>
>> This is because cron doesn't act as a logon session (or is it
>> "interactive" session ... ?) so things that're set in your environment
>> via .profile (.bash_profile, .bashrc, and so on) aren't available to the
>> job when launched via cron "by default".
>>
>> I'm kinda interested to hear what the XDG_RUNTIME_DIR had to do with
>> playing sounds as well. Was it really that the sound wouldn't play, or
>> was something else happening? For example, you couldn't read some other
>> file that triggered "which sound"?
>>
>
> I have a shell script that uses vlc to play various radio/media from the
> command line via my bluetooth soundbar.
>
> When I tried to prepare a home-grown suite that uses the same vlc to
> play media from disk via a web interface (produced from shell scripts) I
> found had to add XDG_RUNTIME_DIR and PULSE_COOKIE directives to get the
> sound out through the soundbar.
>
> Unfortunately, I can't remember where I got the idea from. But it works.

Yeah, VLC needs to know what the XDG_RUNTIME is, for various reasons
(least insofar as I recall).

From the original description, I was thinking more something like
beep(1) being the source of the "sounds".

--
|_|O|_|
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: DDAB 23FB 19FA 7D85 1CC1 E067 6D65 70E5 4CE7 2860

Re: Crontab Question [Solved]

<un6j3a$3mpt4$1@dont-email.me>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7375&group=alt.os.linux.mint#7375

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ala...@invalid.com (Big Al)
Newsgroups: alt.os.linux.mint
Subject: Re: Crontab Question [Solved]
Date: Thu, 4 Jan 2024 10:32:58 -0500
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <un6j3a$3mpt4$1@dont-email.me>
References: <un6b80$3llru$1@dont-email.me> <un6c4m$3lqb6$1@dont-email.me>
<slrnupdg6k.clb.dan@djph.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 4 Jan 2024 15:32:59 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="52109b403f8cbe13b31de0fac0f38e6a";
logging-data="3893156"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18OneMknBs4T/V1cFDRtk7no2aIGT/z+9k="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:e+mUZy23BBpxlbwxOGOG+KDA3X0=
In-Reply-To: <slrnupdg6k.clb.dan@djph.net>
Content-Language: en-US
 by: Big Al - Thu, 4 Jan 2024 15:32 UTC

On 1/4/24 09:27 AM, Dan Purgert wrote:
> On 2024-01-04, Big Al wrote:
>> On 1/4/24 08:18 AM, Big Al wrote:
>>> I have a shell script I can run manually that produces sounds, small
>>> pops sound, as it is running to let me know what stage of the program
>>> it's in.    Works great running it from a launcher or opening my bin
>>> folder to run it.
>>>
>>> I put it in cron and it runs too, but the sounds don't work.  The
>>> tail end creates a notification that pops up either way I run it, but
>>> it's just the sounds that don't work as cron.
>>>
>>> I created it via crontab -e.  As me the user not root of course.
>>> Any ideas.
>> Found it, and this happens so often. One last google and I type the
>> right query.
>>
>> export XDG_RUNTIME_DIR="/run/user/1000"
>> Needs to be put in the shell script. I'm not good enough to know why
>> but evidently cron has no idea of my working environment and this line
>> gives it the needed config to be able to direct sound to my audio
>> properly.
>
> This is because cron doesn't act as a logon session (or is it
> "interactive" session ... ?) so things that're set in your environment
> via .profile (.bash_profile, .bashrc, and so on) aren't available to the
> job when launched via cron "by default".
>
> I'm kinda interested to hear what the XDG_RUNTIME_DIR had to do with
> playing sounds as well. Was it really that the sound wouldn't play, or
> was something else happening? For example, you couldn't read some other
> file that triggered "which sound"?
>
Looking in .xession-errors I see 3 errors in a row, and repeated again 2 more times.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
About the right timing for when I was testing. My program runs:
play -q ~/Music/Sound_Effects/Blop.ogg -t alsa
3 times when runs. This seems to match up.

I just ran it from cron and these errors appear 'with' my patch in the script.
So in as much as the music plays, I still produce these 3 errors. I'm not concerned, the script runs and I see no ill
effect and it only runs @ 8:30am once a day. Not like I'm going to clog .xsessions-errors.
--
Linux Mint 21.2 Cinnamon
Al

Re: Crontab Question

<s6s5qH.D6Cw@yahoo.com>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=7378&group=alt.os.linux.mint#7378

 copy link   Newsgroups: alt.os.linux.mint
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jackstra...@yahoo.com (Jack Strangio)
Newsgroups: alt.os.linux.mint
Subject: Re: Crontab Question
Date: Fri, 5 Jan 2024 08:47:20 -0000 (UTC)
Organization: North Star Horizon Builders Club
Lines: 34
Message-ID: <s6s5qH.D6Cw@yahoo.com>
References: <un6b80$3llru$1@dont-email.me>
Injection-Date: Fri, 5 Jan 2024 08:47:20 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="473dc96f4935f5dc7bd77efc1010a1a6";
logging-data="118353"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+WhBxAbOLyRMbqEZPXLkp4VqL3FnQZWlg="
Cancel-Lock: sha1:rd4kTyp63otZO+SGDosr83Ycdag=
X-Newsreader: TASS News Reader 3.7.2 jvs [linux]
 by: Jack Strangio - Fri, 5 Jan 2024 08:47 UTC

Big Al <alan@invalid.com> writes:
> I have a shell script I can run manually that produces sounds, small pops sound, as it is running to let me know what
> stage of the program it's in. Works great running it from a launcher or opening my bin folder to run it.
>
> I put it in cron and it runs too, but the sounds don't work. The tail end creates a notification that pops up either
> way I run it, but it's just the sounds that don't work as cron.
>

> I created it via crontab -e. As me the user not root of course.
That could be your trouble. The 'cron root' user (for want of a better
description) has a completely different environment and $PATH than you do,
or even 'root' does.

So all calls to binaries, scripts, etc must be in full, absolute pathname.
Note that you can set a $PATH or a special environment for 'cron root' or
other user but that will apply to all the entries in that crontab.

I set an environment variable called $CRONJOB in my crontabs, so any binary
or script knows that it's running as a cron job, and not being called as a
normal user script. I also set a special cron $PATH.

You should be able to produce sounds from a cron job. I used to have one
that ran every day at six PM.

Regards,

Jack

--
I could tell you a joke about UDP.
But you might not get it.

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor