I am required to write a script that would download a file (based on a provided url to that file) using wget and then pipe the result to the mail command so that it can be mailed to a provided email address. This will be used in a php based project.
“Piping the result” preferably would be a built link to the file on the server, so that the recipient of the mail could just click the link and get the file locally.
Anyone have experience in this area of combining commands they would share?
Pseudocode, might even work directly, save it to a file and call it with 2 parameters, first one is the url of the remote file you wish to download, second is the email where to send the notification.
LOCALPATH variable should be a directory which is accessible from www and LOCALURL should match that location.