Skip to content
Pedro A. Hortas edited this page Apr 25, 2015 · 14 revisions

Downloading an usable release

Currently, the only usable tree is the v0.1. Download it using wget:

~$ wget https://github.com/ucodev/usched/archive/v0.1-beta-06.tar.gz

Or via curl:

~$ curl -LO https://github.com/ucodev/usched/archive/v0.1-beta-06.tar.gz

Deploying uSched

Use the fast track:

~$ tar zxvf v0.1-beta-06.tar.gz
~$ cd usched-0.1-beta-06
~$ su
Password:
~# ./deploy

This will install all the required libraries and uSched binaries

Starting uSched

You may want to check the INSTALL.txt file to install the init scripts for your Operating System, but if you want to start uSched right now, just do the following:

~# usched start

Performing some initial tests

If you want to know if your uSched installation is working, try something simple:

~$ usc run 'df >> /tmp/df.out' in 2 seconds then every 5 seconds
(wait 2 seconds)
~$ tail -f /tmp/df.out

If everything is OK, you'll see your partition information being appended to /tmp/df.out every 5 seconds.

Playing around with uSched

Run the do_backups.sh script at 23:00 and then run it every 24 hours:

~$ usc run '/usr/local/bin/do_backups.sh' on hour 23 then every 24 hours

Dump 'df -h' output into /tmp/disk_stats.log after 10 minutes of running this command, and run it again every 30 minutes:

~$ usc run '/bin/df -h >> /tmp/disk_stats.log' in 10 minutes then every 30 minutes

Run the command 'sync' now, repeat every 45 seconds and stop when the time is 12:00:

~$ usc run '/bin/sync' now then every 45 seconds until to time '12:00:00'

Send a some sort of notification in 30 minutes:

~$ usc run '/usr/local/bin/notify.sh something' in 30 minutes

Capture network traffic on interface eth0 between 8:00 and 18:00, every day:

~# usc run 'tcpdump -i eth0 -w /tmp/traffic_`date +%Y%m%d`.dump' on hour 8 every 1 day
~# usc run 'killall tcpdump' on hour 18 every 1 day

Playing around with remote features

Perform a request on a remote machine running uSched:

~$ usc -H remote.example.com -U username run '/usr/local/bin/do_something.sh' on time 11:00:00
Password:
~$

You can also use the non-recommended -P flag in order to inline the password on the command-line:

~$ usc -H remote.example.com -U username -P userpass run '/usr/local/bin/do_something.sh' on time 11:00:00

Integrate uSched on your apps

Check the Library Usage Examples section of README.md.

Getting involved

Check the Contributions section of this wiki.