Ftp upload cronjob
Hi, i'm a fairly basic linux users so excuse any stupidity :)
I was wondering if anyone might be able to help me out in locating a single file ftp script. What i want to do is: - XML file - Connect to ftp - Upload xml file - Replace if file already exists - Cronjob every 5 minutes So basically upload a single file called "myfile.xml" to my server (which is a webserver) via ftp via a cronjob from a linux machine/server. When its uploading it will need to replace the file that was previously there. Is there anything easily obtainable for this? Thanks for anyone who might be able to help out. Regards Alan |
Hi,
Take a look at Code:
ncftpput |
since ftp was designed to prompt the user for input, i would recommend scp.
|
You should read a manual on SSH and how to install authentication keys on the server to allow actions without human interaction (login). 'scp' is basically a wrapper for SSH to transfer data to/from remote locations. With authentication in place, your cron script would have something like:
Quote:
JD Linux Archive |
if it HAS to be ftp you could simply create a php script
Code:
<?php then simply tell the cron job to run 'php myscript.php' every 5 minutes |
Quote:
Code:
#!/bin/bash |
#!/bin/bash
rsync localfile user@remotebox:/usr/data/ I'm partly suggesting and asking, I think rsync will make the task more simple, comments please? |
Cheers guys there are definatly some goo options here for me to takke, the php mentod might actually be the best option for me as i am familiar with this however custangros solution looks like another good one for me as i can kinda understand that.
Once again thanks guys. I really appreciate your help. |
All times are GMT -5. The time now is 04:24 AM. |