![]() S.setsockopt(socket.SOL_SOCKET,socket.SO_BROADCAST,True)īy the way, highly important the point Yoda made is for young apprentice Jedis, better nothing is than GUI.īut listen well, Anakin - when you are not in the office or just can't be bothered to manually back up every night (no matter how nice the GUI is for waking up the remote computer), copy the python code into a file, make it executable, and have your shell script execute it before it runs the backup commands (rsync over ssh, anyone?) One datum of note: For your python script to run on a Linux system (and I assume Unix as well) you need to add the following line just after you declare the s variable: I wasn't in the office, working over a VPN - very happy when ssh finally got through. Thanks a lot for the data - I am a sysadmin and I really needed to wake my macs up to run backups. S=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) Here is a Python script that does this (if your MAC address is 01-23-45-67-89-0a: #!/usr/bin/env python The easiest way to do this is to send a broadcast. The magic packet format is very simple: it must include anywhere in the packet 6 times hexadecimal FF, followed by 16 times the Mac's MAC address (pun intended). I use this feature to turn on my iMac from my office when I want to log on using ssh (I have a Solaris machine on my home LAN that runs 24/7). I haven't found any trace of this documented on Apple's web site, but it seems Macs also implement this feature (at least my iMac G4 does). ![]() This is used, for instance, to allow backup programs to run at night. ![]() This is designed to allow a network administrator to turn on a computer remotely, even when it is turned off, by sending a "magic packet". ![]() Most modern computers offer a feature called "Wake on LAN". ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |