maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   OS2008 / Maemo 4 / Chinook - Diablo (https://talk.maemo.org/forumdisplay.php?f=29)
-   -   Automatic Muting via cron (https://talk.maemo.org/showthread.php?t=20966)

t24 2008-06-24 19:48

Re: Automatic Muting via cron
 
Quote:

Originally Posted by cybergypsy (Post 191971)
Thanks maillaxa, thats great!

For anyone else who would like to get this working , here is what I have done.
I set all this up via SSH on my desktop rather than the built-in terminal, this allows easy copy & paste as well as file transfers via secure copy (scp)
  1. Installed the aumix-gtk applcation from the repositories.
  2. Installed the cron package from this thread.
  3. As root created a crontab containing :-
    Code:

    30 23 * * * aumix -w 0
    00 7 * * * aumix -w 90

    This mutes the tablet at 11:30pm and un-mutes it at 07:00am
  4. Either reboot or run cron from the command line.

Good Luck
cybergypsy

Can you tell a little more please?

As root, I installed cron, and run crontab -e .. I entered something similar, " 30 23 * * * mplayer file.mp3 " but nothing happens at 23:30... I tried to edit /etc/crontab.. nothing happened

thx

cybergypsy 2008-06-24 19:59

Re: Automatic Muting via cron
 
you might need to specify the path to the .mp3 file as the command will be running as root and not as user.

I don't think the crontab files are stored in /etc , I think they're in /var somewhere but I can't check at the moment as I don't have it all installed currently due to the diablo upgrade this afternoon.

alephito 2008-06-24 20:51

Re: Automatic Muting via cron
 
The crontab files are stored in /tmp.

alephito 2008-06-24 21:06

Re: Automatic Muting via cron
 
Quote:

Originally Posted by alephito (Post 195047)
I am sure I am root (I see the # in the command line) and I run tar with the 'zxvvf' parameters. How can I check if the script is set as executable?

EDIT: Where should I be positioned to untar the files? If I am in the root directory (/root) the permissions are well assigned (but ./cron/INSTALL fails for other reason). The problem happened standing in mmc1.

Now, I get this when I execute ./cron/INSTALL:

~# ./cron/INSTALL
./cron/INSTALL: line 3: ./UNINSTALL: not found
cp: omitting directory './cron'
cp: cannot stat './crontab': No such file or directory
chmod: /usr/bin/cron: No such file or directory
chmod: /usr/bin/crontab: No such file or directory
ln: /etc/rc2.d/S89cron: File exists

alephito 2008-06-24 22:52

Re: Automatic Muting via cron
 
I solved doing this:

cd /root/cron
./INSTALL

Why './cron/INSTALL' did not work to begin?

Benson 2008-06-25 02:57

Re: Automatic Muting via cron
 
Because it was looking for ./UNINSTALL, not ./cron/UNINSTALL, and so on.

t24 2008-06-25 04:35

Re: Automatic Muting via cron
 
Quote:

Originally Posted by alephito (Post 195217)
The crontab files are stored in /tmp.

actually it seems to be in /var (chinook)

Anyway.. doesn't work for me >o<

# more /var/cron/tabs/root gives me

===========
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.3312 installed on Wed Jun 25 13:33:30 2008)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
35 13 * * * /usr/sbin/reboot
===========

which i created with crontab, as root.

But no reboot at 13H35.. Is my command ok?

I think cron is running since it shows with ps -aux | grep cron

I'm puzzled

qwerty12 2008-06-25 05:47

Re: Automatic Muting via cron
 
Quote:

Originally Posted by t24 (Post 195174)
Can you tell a little more please?

As root, I installed cron, and run crontab -e .. I entered something similar, " 30 23 * * * mplayer file.mp3 " but nothing happens at 23:30... I tried to edit /etc/crontab.. nothing happened

thx

" 30 23 * * * run-standalone.sh mplayer file.mp3 "

Mplayer sends a dbus command along the line. cron runs as root. dbus and root don't go so well on tablets hence the run-standalone.sh.

t24 2008-06-25 06:42

Re: Automatic Muting via cron
 
Quote:

Originally Posted by qwerty12 (Post 195431)
" 30 23 * * * run-standalone.sh mplayer file.mp3 "

Mplayer sends a dbus command along the line. cron runs as root. dbus and root don't go so well on tablets hence the run-standalone.sh.

Nope, doesn't work for me... mplayer or anything else, run-standalone.sh or not... Nothing never happens :mad:

What am I doing wrong???

Recap :
1- on my n810, downloaded the package from the thread "cron has gone".. cron.tar.gz (.zip)

2- as root, used the INSTALL script

3 - rebooted, checked with ps -aux | grep cron... which gives me
1220 root 1548 SW /etc/rc2.d/S89cron start

4 - as root, crontab -e, added the line
30 23 * * * run-standalone.sh mplayer file.mp3

5 - checked it's in /var/cron/tabs/root

6 - wait

7 - weep

alephito 2008-06-25 11:19

Re: Automatic Muting via cron
 
Quote:

Originally Posted by Benson (Post 195376)
Because it was looking for ./UNINSTALL, not ./cron/UNINSTALL, and so on.

Does it mean there is an error in the INSTALL file?


All times are GMT. The time now is 16:29.

vBulletin® Version 3.8.8