martes, 19 de febrero de 2008

Retrieve a Remote File - by Email

I found this interesting article in Murphy Mac's blog. It will give you an Idea of how to retrieve remotely a file from home and view it on an iPhone, iTouch or even an laptop.

Here’s the scenario: You’re on the bus, you realize your French homework is sitting at home on your Mac. Send yourself a text message with the path to the file. By the time you get to school and log on to a computer your file has been emailed. Problem solved.
Configure Murphy’s script to run every so often using something like launchd. Then send yourself an email. Include the path to the file you want sent in the body, like this:
/Users/murphy/Documents/PenskeFile.doc.
Mail will create a new message, attach the file, and send it to the address in the script. You can configure the script to run when a certain word is in the email subject, like FileGrab. This is an ideal use for rules in Mail.app. But rules don’t seem to work in Mail as of 10.5.1. Murphy hasn’t tried 10.5.2 yet.
Instead of using rules, this script is written to run periodically. Maybe every ten minutes or so. If it sees an email with the keyword in the subject it checks for the file and sends it. If the file doesn’t exist the script sends an email that says so.
Security hole? Well, Murphy doesn’t think so. The file will only be mailed to the address you specify in the script, it’s not a reply. (you could alter the script to have it reply, but that doesn’t seem like a good idea.) You can use secure email to send the request and the file. That’s secure.
Getting back to the mobile devices: Your unhacked iPhone and touch don’t let you download files. So you can’t SSH back to the house and grab the file. You could set up your Mac as a web server, but I wouldn’t want to do that.
Using this script the file is emailed to you, so you can view it in Mobile Mail or Gmail depending on what kind of file it is. You can easily view the file later, when you’re offline. The catch? You need to know the path to the file you’re retrieving.
Windows Users: Have a look here.
Note: Script requires use of Mail.app. To schedule this script to run on a schedule you might want to try something like lingon for editing your launchd configuration.
Other Murphy scripts for working with Mail:
Sleep Your Mac by Email
Select a Playlist by Email
Request from Murphy: There are two entries on Digg. Please use this link if you’d like to Digg this.Download Script Permalink

No hay comentarios: