Hack41.Run Skype Based on Time of Day


Hack 41. Run Skype Based on Time of Day

Control when Skype starts and stops to ration bandwidth usage, or to regain explicit control over when you are available online.

Works with: Windows, Linux, and Mac OS X versions of Skype.

By controlling when Skype runs, you can ration the amount of Internet bandwidth your machine uses, and therefore cumulative Internet traffic, which is important if you pay for Internet connectivity by the megabyte or even gigabyte. Also, at the same time, you regain explicit control over when you are available online, which may be important if you want to be available only from, say, 9 a.m. to 5 p.m., Monday through Friday.

Here's how you can start and, almost as importantly, stop Skype based on the day of the week and time of the day:


Windows

Start Windows' task scheduler (Start All Programs Accessories System Tools Scheduled Tasks). Click on Add Scheduled Task, name the task Skype Start, and follow the instructions in the Scheduled Task Wizard to run (start) Skype.exe on your chosen days and times. Next, click on Add Scheduled Task again, name this task Skype Stop, and again follow the instructions in the Scheduled Task Wizardbut this time, before you click the Finish button, check the "Open advanced properties for this task when I click Finish checkbox. This will open a properties window, into which you should add the command-line option Skype.exe /shutdown for Skype to stop running on your chosen days and times.


Linux

Edit your crontabs file using the command crontabs e (this will create a new crontabs file if one doesn't already exist), and add these entries to run Skype between 9 a.m. and 5 p.m., Monday through Friday only:

 DISPLAY=:0 0 9 * * 1-5 /usr/bin/skype 0 17 * * 1-5 killall skype 

Note that if you omit DISPLAY=:0, you will likely find that Skype won't be displayed on your screen.


Mac OS X

This also uses crontabs, but these are the entries you must add:

 0 9 * * 1-5 open a /Applications/Skype.app/Contents/MacOS/Skype 0 17 * * 1-5 killall Skype 

Note that if you don't use open a as shown earlier, Skype will prompt you for your Skype name and password regardless of whether you have checked the "Remember my name and password on this computer" checkbox. In this case, if you are not there when cron starts Skype, Skype will be running, but you won't be logged on!

Pay particular attention to spelling for Linux and Mac OS X, as they're both case sensitive. On Linux, the Skype executable is skype (all lowercase), and on Mac OS X it is Skype (first letter capitalized).




Skype Hacks
Skype Hacks: Tips & Tools for Cheap, Fun, Innovative Phone Service
ISBN: 0596101899
EAN: 2147483647
Year: 2005
Pages: 168

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net