Choose style:

Author Topic: Issue with Crontab [SOLVED]  (Read 1974 times)

0 Members and 1 Guest are viewing this topic.

Offline rmcellig

  • Member
  • ***
  • Posts: 205
  • Karma: 13
  • New Forum User
    • View Profile
Issue with Crontab [SOLVED]
« on: October 05, 2015, 04:20:13 pm »
On my Dell 3000 I am having problems recording using Cron.

This is the code that I am using that works perfectly well from the terminal but not Cron.

Code: [Select]
45 5 * * 1 /usr/bin/arecord -t wav -f cd -d 100 /home/randy/TEST2.wav


45 5 * * 1 /usr/bin/arecord -t wav -f cd -d 100 $HOME/TEST2.wav


Any idea what I should do? It happens using Peppermint 5, 6 Lubuntu 14.04 and now Xubuntu 14.04 which is what I am in now. Puppy Linux works fine no problems at all.
« Last Edit: October 06, 2015, 11:22:09 am by rmcellig »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25451
  • Karma: 2798
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Issue with Crontab
« Reply #1 on: October 05, 2015, 05:31:53 pm »
so when are you trying to run the job ?

and I take it this is in the users (randy) crontab ?
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline rmcellig

  • Member
  • ***
  • Posts: 205
  • Karma: 13
  • New Forum User
    • View Profile
Re: Issue with Crontab
« Reply #2 on: October 05, 2015, 05:58:10 pm »
Yes this is under my crontab. When I am in the terminal and type crontab -e, my list of jobs comes up.

When I set the job in my crontab  and specify whatever time I want it to run, it runs but there is no sound recorded. When I run from terminal, it runs properly sound intact.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25451
  • Karma: 2798
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Issue with Crontab
« Reply #3 on: October 05, 2015, 06:22:34 pm »
Are you sure you're setting the right time and saving the crontab because a 10 second recording with:
Code: [Select]
19 23 * * 1 XDG_RUNTIME_DIR=/run/user/1000 /usr/bin/arecord -t wav -f cd -d 10 $HOME/TEST2.wav
worked for me

You can get your XDG_RUNTIME_DIR with
Code: [Select]
echo $XDG_RUNTIME_DIR

[EDIT]

If you run:
Code: [Select]
alsamixer
then hit the F4 key to show the capture volume, what's it set to ?
« Last Edit: October 05, 2015, 07:39:55 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25451
  • Karma: 2798
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Issue with Crontab
« Reply #4 on: October 05, 2015, 07:17:33 pm »
As we're using pulseaudio you might also want to try
Code: [Select]
45 5 * * 1 XDG_RUNTIME_DIR=/run/user/1000 timeout 10 parecord -r $HOME/TEST2.wav
you can get your XDG_RUNTIME_DIR with
Code: [Select]
echo $XDG_RUNTIME_DIR
« Last Edit: October 05, 2015, 07:33:06 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline rmcellig

  • Member
  • ***
  • Posts: 205
  • Karma: 13
  • New Forum User
    • View Profile
Re: Issue with Crontab
« Reply #5 on: October 05, 2015, 08:19:36 pm »
Thanks! I will give that a try and post back.

Offline rmcellig

  • Member
  • ***
  • Posts: 205
  • Karma: 13
  • New Forum User
    • View Profile
Re: Issue with Crontab
« Reply #6 on: October 06, 2015, 09:39:18 am »
I tried the code you suggested above and so far it works. Is this because the new code is specifying that user randy be used and that's why it works in Puppy Linux because puppy linux uses root? I think I understand where you are going in having me try out this new code for recording from Cron. I'm still running tests throughout the day AND I also did a clean install of Peppermint 6 on my Dell 3000. Even though distro hopping is fun I like to use a reliable solid distro that stays on machine for some time.

I guess I can always run Openbox or jwm from a new session if I want something leaner?
« Last Edit: October 06, 2015, 09:42:04 am by rmcellig »

Offline Slim.Fatz

  • Trusted User
  • Veteran
  • *****
  • Posts: 1752
  • Karma: 466
  • Where's the mouse?
    • View Profile
  • Peppermint version(s): Peppermint 7, 8.5 & 10 - 64bit
Re: Issue with Crontab
« Reply #7 on: October 06, 2015, 10:46:01 am »
I guess I can always run Openbox or jwm from a new session if I want something leaner?

Hi rmcellig,

I'm not sure sure what that comment has to do with the thread's subject (Crontab), but the answer is yes. I alternate between Openbox, JWM and i3wm with the standard Peppermint Six wm almost never getting used anymore ...

Regards,

-- Slim
"Life first -- Peppermint a close 2nd!" -- Zeb

Tread lightly: Fluxbox, JWM, i3, Openbox, awesome

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25451
  • Karma: 2798
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Re: Issue with Crontab
« Reply #8 on: October 06, 2015, 10:54:50 am »
pulseaudio (which is no doubt your default sound device) requires the XDG_RUNTIME_DIR environment variable to be set correctly when run on your behalf .. I'm afraid that's all I can tell ya ;)
« Last Edit: October 06, 2015, 10:58:02 am by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline rmcellig

  • Member
  • ***
  • Posts: 205
  • Karma: 13
  • New Forum User
    • View Profile
Re: Issue with Crontab
« Reply #9 on: October 06, 2015, 11:21:12 am »
Thanks for the Pulseaudio explanation.

I don't know why I put that little blurb about a leaner system. I guess it's because I have used Openbox, JWM and even i3 in the past and love the simplicity and speed. I use Puppy Linux off and on but don't feel quite comfortable being root all the time.

Slim, do you have a tutorial available explaining how to create a successful session with Openbox, jwm or whatever? I know I am off topic in this thread so I am going to mark this thread solved.

Offline Slim.Fatz

  • Trusted User
  • Veteran
  • *****
  • Posts: 1752
  • Karma: 466
  • Where's the mouse?
    • View Profile
  • Peppermint version(s): Peppermint 7, 8.5 & 10 - 64bit
Re: Issue with Crontab
« Reply #10 on: October 06, 2015, 12:32:32 pm »
Slim, do you have a tutorial available explaining how to create a successful session with Openbox, jwm or whatever? I know I am off topic in this thread so I am going to mark this thread solved.

No, I don't. I have, however, posted several things that you might find useful. These postings (on our forum here) are not really tutorials about Openbox sessions, but maybe you can use them:

This posting has my Openbox config files that you can download. They have many comments that can perhaps help explain what the different settings/options actually do. For a beginner they can hopefully speed up getting Openbox set up the way you want it to be.

This posting explains how to set up your mouse's scroll wheel to change from one workspace to another without having to point at anything other than an empty area on your desktop.

And this posting might be useful if you wish to have your wallpaper regularly change to a wallpaper that gets randomly selected from a folder containing your favorite wallpapers.

If you have any questions about these postings, put them in a reply within the corresponding thread rather than here in this thread.

If I get some time I might try to write up something about JWM and/or i3. I'm just too busy now.

Regards,

-- Slim
"Life first -- Peppermint a close 2nd!" -- Zeb

Tread lightly: Fluxbox, JWM, i3, Openbox, awesome