-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME
152 lines (73 loc) · 4.27 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
1. Summary
A free and open source command-line scheduler with an almost-natural language interpreter, delivering remote management and an intuitive programming interface for multiple programming languages.
2. Description
uSched services provide an interface to schedule commands to be executed at a particular time, optionally repeating them over a specified interval, and optionally stopping them at any other particular time.
It provides a simple and intuitive natural language that is intepreted via a command line client, but can also be integrated into any programming language through its client libraries and bindings.
It also operates as a client/server, where requests performed by clients can affect local or remote machines where uSched services are running.
3. Portability
uSched is designed to be compliant with any POSIX operating system. There are some features that may not be enabled by default in the case that some non-portable calls being unavailable for the target operating system, such as chroot(). To disable such calls and features, set the CONFIG_POSIX_STRICT definition to 1 in the include/config.h file.
uSched client will compile on most Windows versions and the API bindings are available for C#.
4. Installation
Perform the following commands:
~# cd /usr/src
~# mkdir usched
~# wget https://github.com/ucodev/usched/archive/master.tar.gz
~# tar zxvf master.tar.gz -C usched
~# cd usched
~# ./deploy
or
See INSTALL.txt
5. Command-Line Usage Examples
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
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:
~$
Show all scheduled entries for the user by running the following command:
~$ usc show all
Stop all scheduled entries for the user by running the following command:
~$ usc stop all
6. Documentation
Reference Manual in HTML format:
http://doc.usched.org/uSched_Reference_Manual.html
Reference Manual in PDF format:
http://doc.usched.org/uSched_Reference_Manual.pdf
Overview manual page:
usched(7)
Command-line manual pages:
usched(1), usa(1), usc(1), usd(1), use(1), usm(1)
Programmer's manual pages:
usched_destroy(3), usched_init(3),
usched_opt_set_remote_hostname(3), usched_opt_set_remote_port(3)
usched_opt_set_remote_username(3), usched_opt_set_remote_password(3),
usched_request(3),
usched_result_free_run(3),
usched_result_free_show(3),
usched_result_free_stop(3),
usched_result_get_run(3),
usched_result_get_show(3),
usched_result_get_stop(3),
usched_usage_error(3), usched_usage_error_str(3)
Generate Doxygen HTML files (into doc/doxygen/doxyfiles/):
~$ make doxygen
Brief installation guide:
INSTALL.txt
7. Library Usage Examples
See example/ directory for library usage examples in C, C#, Java, PHP, and more.
8. License
uSched is licensed under the GNU General Public License version 3.
9. Contributing
The best way to do it is through GitHub. Clone it, fork it, change it and improved it. Then check the [project wiki](https://github.com/ucodev/usched/wiki) for details regarding the submission of contributions.
10. Notes
Tree version v0.1 is now considered stable.
Tree version v0.2 is under development and may not be fully functional.