Go Back   HostGator Peer Support Forums > Public Forums > Pre-Sales Questions

Notices

Reply
 
Thread Tools
  #1  
Old 01-02-2008, 06:31 PM
moby moby is offline
Hatchling Croc
 
Join Date: Dec 2007
Posts: 7
Default replicating via ftp and cron...

Hi Guys,

Do you have any scripts you use/can-share that replicate dirs (recursively) from one FTP server to another..

My current server doesnt allow rsync...

Ideally one that performs an accurate diff.. so only new/changed files are copied. I can then run this weekly/monthly via cron.

Cheers
Reply With Quote
  #2  
Old 01-02-2008, 10:31 PM
special's Avatar
special special is offline
Junior Croc
 
Join Date: Dec 2007
Location: Netherlands
Posts: 111
Default Re: replicating via ftp and cron...

I dont have that, tho I have something for big filetransfers from server to server, ive tested it with firefoxs, and even if the browser stops loading it keeps getting the file. So no timeouts are effected.

Heres the code hope it helps.

Code:
<?php
if ($_GET[xfer]) {
if ($_POST[from] == "") {
print "You forgot to enter a url.";
} else {
copy("$_POST[from]", "$_POST[to]");
$size = round((filesize($_POST[to])/1000000), 3);
print "transfer complete.<br>
<a><a href=\"$_POST[from]\">$_POST[from]</a><br>
<a><a href=\"$_POST[to]\">$_POST[to]</a> : $size MB";
}
} else {
print "<form action=\"$PHP_SELF?xfer=true\" method=post>
from(http://): <input name=from><br>
to(filename): <input name=to><br>
<input type=submit value=\"transload\">";
}
?>
Exampel: save the code as transload.php chmod it to 777 and cmod the directory to 777 and it works like a charm.
__________________
Me Love www.animeresource.org
Reply With Quote
  #3  
Old 01-02-2008, 11:10 PM
Jordanlw's Avatar
Jordanlw Jordanlw is offline
Royal Croc
 
Join Date: Dec 2007
Location: Australia
Posts: 425
Default Re: replicating via ftp and cron...

@Special im not able to get it working....
And ive been looking for exactly this kind of thing...
__________________
http://free-vent.com Providing FREE PUBLIC Ventrilo (VOIP) use.
Reply With Quote
  #4  
Old 01-03-2008, 05:44 AM
OneManShow's Avatar
OneManShow OneManShow is offline
Junior Croc
 
Join Date: Jul 2007
Location: http://localhost/
Posts: 131
Default Re: replicating via ftp and cron...

Quote:
Originally Posted by special View Post
I dont have that, tho I have something for big filetransfers from server to server, ive tested it with firefoxs, and even if the browser stops loading it keeps getting the file. So no timeouts are effected.

Heres the code hope it helps.

Code:
<?php
if ($_GET[xfer]) {
if ($_POST[from] == "") {
print "You forgot to enter a url.";
} else {
copy("$_POST[from]", "$_POST[to]");
$size = round((filesize($_POST[to])/1000000), 3);
print "transfer complete.<br>
<a><a href=\"$_POST[from]\">$_POST[from]</a><br>
<a><a href=\"$_POST[to]\">$_POST[to]</a> : $size MB";
}
} else {
print "<form action=\"$PHP_SELF?xfer=true\" method=post>
from(http://): <input name=from><br>
to(filename): <input name=to><br>
<input type=submit value=\"transload\">";
}
?>
Exampel: save the code as transload.php chmod it to 777 and cmod the directory to 777 and it works like a charm.
me too, can you write for us the whole code , please
__________________
Enjoy Being a HostGator Customer
Reply With Quote
  #5  
Old 01-03-2008, 07:10 AM
Jordanlw's Avatar
Jordanlw Jordanlw is offline
Royal Croc
 
Join Date: Dec 2007
Location: Australia
Posts: 425
Default Re: replicating via ftp and cron...

Its works for small files...
And im going to guess its not working because of the limitations on the HG servers?
__________________
http://free-vent.com Providing FREE PUBLIC Ventrilo (VOIP) use.
Reply With Quote
  #6  
Old 01-03-2008, 09:08 AM
moby moby is offline
Hatchling Croc
 
Join Date: Dec 2007
Posts: 7
Default Re: replicating via ftp and cron...

thats a nice tool.. but no use for me

im needing a recursive grab script..

3000+ files. but preferably only the ones that have changed.
(this is to sync two gallery2 mirrors)
Reply With Quote
  #7  
Old 01-03-2008, 01:24 PM
special's Avatar
special special is offline
Junior Croc
 
Join Date: Dec 2007
Location: Netherlands
Posts: 111
Default Re: replicating via ftp and cron...

My script is working fine I use it to transload files from 180/240mb filesize I can show it to you like 123. But the server at hand shoud have hotlinking off I mean if hotlinking is on on the site where your downloading from forget it it wont work.

http://www.animeresource.org/include/transload.ace unpack with winace or any other program that supports winace. chmod file itself to 777 and the directory.

It works 100% ive bin using my script for 6 months now dident inprove it cause it dus the job. And moby, you can use this script as a base and inprove it into a directory downloader. you will however have to make sure the directory is exposed or type a full list of the files that need to be downloaded.

Anyone really wants to use this transload script, and is unable to get it working add my msn admin@animeresource.org and ill do my best to assist you.
__________________
Me Love www.animeresource.org
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 10:13 PM.

 
Forum SEO by Zoints