logo sykohpath.com

				where code goes to die
			
	
tagstags

Set up a cron job

A cron job is a way to "automatically" run a script at a specific interval.  It's not too difficult to setup.

1) From terminal, edit the cron table:
crontab -e
2) That starts a VI session to enter lines.  Press i to start edit mode.
3) Add the job in the following format:
<minute>     <hour>     <month_day>     <month>     <week_day>     [removed]
So, an example to run a script every weekday (1-5) at midnight (0:0), every month (*):
0    0    *    *    1-5    /home/sykohpath/scripts/script.sh
4) When finished, press ESC, then : to bring up the prompt, and finally save and quit by typing x

Note: An email is sent to the useracount that executes the cron job, so it's a great way to get confirmation that the script ran automatically or not.  However, this can get annoying, so to disable it, add the following at the end of the cron job line that emails are not desired:
/dev/null 2>&1
(write output to null).

Reference: Crontab Quick Reference

linux, reference,


0 comments.

tagstags

SSH Tunnel

Mainly for my reference since I can't seem to remember exactly:

ssh -D <port> <user>@<host>

Configure software to use SOCKS proxy:

localhost:<port> OR 127.0.0.1 using <port>

linux, reference,


0 comments.