pseudomonas: My rat is confused by technology (technology)
[personal profile] pseudomonas
Just for my own reference, and in case anyone else wants to do this:

I have jobs on my laptop that I want to run at home, but not automatically on someone else's network (might be bandwidth intensive, for instance). I also wanted the script to notify me that it's started running.

I have them in a bash script that I can run manually with ./script.bash or in a cron job as /path/to/script.bash cron

Within the scripts, the relevant lines are:
test "$1" != "cron" || (/sbin/iwconfig wlan1 | grep 'ESSID:"PSEUDOMONAS_ESSID"') || exit
DISPLAY=:0.0 XAUTHORITY=~/.Xauthority notify-send "Notification" "Starting jobs"


I had to fiddle and web-search a bit to work out how to get things working. /sbin/ not being in path for cron jobs was a bit of a gotcha. I run Xubuntu 11.04 FWIW.

Date: 2011-08-18 11:05 pm (UTC)
gerald_duck: (Default)
From: [personal profile] gerald_duck
But surely someone else's network is precisely where you want to run bandwidth-intensive stuff? (-8<

Profile

pseudomonas: "pseudomonas" in London Underground roundel (Default)
pseudomonas

November 2024

S M T W T F S
     12
34567 89
10111213141516
17181920212223
24252627282930

Most Popular Tags

Page Summary

Expand Cut Tags

No cut tags
Page generated Jun. 19th, 2025 11:29 am
Powered by Dreamwidth Studios

Style Credit