A simple cron job to simulate a grandfather clock.
Designed for a server installation of Ubuntu (wife says: gotta make that server do something cool than watch it sitting around doing nothing and taking up space.)
Manual Ubuntu Install
user@machine:~$ sudo -i
root@machine:~$ apt-get install libasound2 libasound2-plugins alsa alsa-utils alsa-oss pulseaudio pulseaudio-utils
root@machine:~$ usermod -aG pulse,pulse-access root
root@machine:~$ pulseaudio -D --system
root@machine:~$ shutdown now -r
Note: if this is a server, the levels maybe muted and.or turned down.
root@machine:~$ alsamixer
- What does the alsa mixer look like? (http://howto.blbosti.com/2010/03/ubuntu-server-install-alsa-sound-and-moc-music-on-console/)
user@machine:~$ sudo -i
root@machine:~$ apt-get install git
root@machine:~$ git clone https://github.com/wanchic/grandfatherclock.git
root@machine:~$ cd grandfatherclock
root@machine:~/grandfatherclock$ mv grandfatherclock /etc/cron.d/.
root@machine:~/grandfatherclock$ mv westminster_bells /usr/share/grandfatherclock
root@machine:~/grandfatherclock$ mplayer /usr/share/grandfatherclock/westminster-01.wav
- Be sure you plugged some speakers into your server. (^_^)
- Be sure they are turned on, turned up a bit, and working. (^_^)
- If this does not work, try adjusting the alsamixer back in Part 1 - Step 5.
root@machine:~/grandfatherclock$ cd /etc/cron.d/grandfatherclock
- See Part 3 - Setup, for more information.
root@machine:~$ /etc/init.d/cron restart
The cron is currently setup to play from 7am to 10pm, 7 days a week. It will also play on every quarter of the hour. With this being a simple cron file, you have the flexibility to adjusting the times however you want! Enjoy (^_^)
15 07-21 * * * root mplayer /usr/share/grandfatherclock/westminster-15.wav
30 07-21 * * * root mplayer /usr/share/grandfatherclock/westminster-30.wav
45 07-21 * * * root mplayer /usr/share/grandfatherclock/westminster-45.wav
00 13 * * * root mplayer /usr/share/grandfatherclock/westminster-01.wav
00 14 * * * root mplayer /usr/share/grandfatherclock/westminster-02.wav
00 15 * * * root mplayer /usr/share/grandfatherclock/westminster-03.wav
00 16 * * * root mplayer /usr/share/grandfatherclock/westminster-04.wav
00 17 * * * root mplayer /usr/share/grandfatherclock/westminster-05.wav
00 18 * * * root mplayer /usr/share/grandfatherclock/westminster-06.wav
00 07,19 * * * root mplayer /usr/share/grandfatherclock/westminster-07.wav
00 08,20 * * * root mplayer /usr/share/grandfatherclock/westminster-08.wav
00 09,21 * * * root mplayer /usr/share/grandfatherclock/westminster-09.wav
00 10,22 * * * root mplayer /usr/share/grandfatherclock/westminster-10.wav
00 11 * * * root mplayer /usr/share/grandfatherclock/westminster-11.wav
00 12 * * * root mplayer /usr/share/grandfatherclock/westminster-12.wav