Need some work done? Post a Project Today
Attention Scriptlance users, Scriptlance has been acquired by Freelancer.com! Find out more
I need a script that retrieves a file from a remote server. Either Perl or shell script is fine, as long as it can run under OS X (Both Perl and shell should work and I will test). Here's what it needs to do:
1) Connect to a remote computer using FTP/TLS. Domain/IP address, port, user/pwd are hard-coded in the script.
2) Go to a directory on the remote computer (remote directory A). Path is hard-coded in the script.
3) Get the file in that remote directory that has the most recent creation date.
4) Copy the file to a directory on the local computer. Path is hard-coded in the script.
5) If copy was successful, move the file on the remote computer from its original location (remote directory A) to another directory on the remote computer (remote directory B). Path is hard-coded in the script.
6) Send an email (address hard-coded) with the success/failure for each step:
- connected to remote computer
- found remote directory A to copy from
- found a file in the remote directory
- read file from remote directory
- found local directory to copy to
- wrote file to local directory
- found remote directory B to move file to
- moved file from remote directory A to remote directory B
Needs to be well commented, and I'd appreciated up-front variables.
Freelancer.com (formerly GetAFreelancer, Scriptlance and vWorker/Rentacoder) is the world's largest freelancing, outsourcing and crowdsourcing marketplace for small business. Hire freelancers to work in software, writing, data entry and design right through to engineering and the sciences, sales and marketing, and accounting & legal services.
Find freelance jobs and make money online! We have freelance coders, writers, programmers, designers, marketers and more. Getting the best web design, custom programming, professional writing or affordable marketing has never been easier!
© Copyright 2013 Freelancer Technology Pty Limited (ACN 142 189 759)
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)