<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>FTP script</title>
		<link>http://mybookworld.wikidot.com/forum/t-163766/ftp-script</link>
		<description>Posts in the discussion thread &quot;FTP script&quot;</description>
				<copyright></copyright>
		<lastBuildDate></lastBuildDate>
		
					<item>
				<guid>http://mybookworld.wikidot.com/forum/t-163766#post-515700</guid>
				<title>Re: FTP script</title>
				<link>http://mybookworld.wikidot.com/forum/t-163766/ftp-script#post-515700</link>
				<description></description>
				<pubDate>Mon, 22 Jun 2009 21:07:33 +0000</pubDate>
				<wikidot:authorName>Creaky</wikidot:authorName>				<wikidot:authorUserId>326842</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>No I didn't, still trying to learn all this.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://mybookworld.wikidot.com/forum/t-163766#post-515560</guid>
				<title>Re: FTP script</title>
				<link>http://mybookworld.wikidot.com/forum/t-163766/ftp-script#post-515560</link>
				<description></description>
				<pubDate>Mon, 22 Jun 2009 18:47:12 +0000</pubDate>
				<wikidot:authorName>frater</wikidot:authorName>				<wikidot:authorUserId>139187</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Did you start your script with…?</p> <div class="code"> <pre> <code>#!/bin/sh</code> </pre></div> <p>I think not<br /> If you forget this, the command will run from the prompt and run bash (because it's invoked from bash)<br /> If you invoke it from cron, it doesn't know what to do with it….</p> <p>remember….</p> <p>In Linux you always have to tell exactly what you want. In windows it will try and correct "false" parameters and then execute the job without giving you any message. This will also mean it can do other things than you really wanted.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://mybookworld.wikidot.com/forum/t-163766#post-515469</guid>
				<title>Re: FTP script</title>
				<link>http://mybookworld.wikidot.com/forum/t-163766/ftp-script#post-515469</link>
				<description></description>
				<pubDate>Mon, 22 Jun 2009 17:26:31 +0000</pubDate>
				<wikidot:authorName>Creaky</wikidot:authorName>				<wikidot:authorUserId>326842</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I now have the script running perfectly when I call it manually but can't get it to work from a cron job. I know cron is installed as I have used a script from frater to install it, I have place my script in the cron.daily directory.</p> <p>How do I get the script to run using cron?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://mybookworld.wikidot.com/forum/t-163766#post-513745</guid>
				<title>Re: FTP script</title>
				<link>http://mybookworld.wikidot.com/forum/t-163766/ftp-script#post-513745</link>
				<description></description>
				<pubDate>Sat, 20 Jun 2009 14:30:03 +0000</pubDate>
				<wikidot:authorName>Creaky</wikidot:authorName>				<wikidot:authorUserId>326842</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Think I've sorted out the above but now getting a <strong>Connection timed out</strong> error message. I can connect to the ftp server using the same user &amp; pass using filezilla but not from the mybook. I'm logging in to the mybook using putty on a Vista machine if that makes any difference.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://mybookworld.wikidot.com/forum/t-163766#post-513273</guid>
				<title>Re: FTP script</title>
				<link>http://mybookworld.wikidot.com/forum/t-163766/ftp-script#post-513273</link>
				<description></description>
				<pubDate>Fri, 19 Jun 2009 19:59:40 +0000</pubDate>
				<wikidot:authorName>Creaky</wikidot:authorName>				<wikidot:authorUserId>326842</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Thanks a lot guys, been a great help.</p> <p>Can now log in but I'm getting an error message around line 6. Any suggestions?</p> <div class="code"> <pre> <code>line 6: unexpected EOF while looking for matching `"'</code> </pre></div> <p>This is line 6</p> <div class="code"> <pre> <code>FILE="dbbackup_$DATE.sql.gz"</code> </pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://mybookworld.wikidot.com/forum/t-163766#post-513244</guid>
				<title>Re: FTP script</title>
				<link>http://mybookworld.wikidot.com/forum/t-163766/ftp-script#post-513244</link>
				<description></description>
				<pubDate>Fri, 19 Jun 2009 19:27:09 +0000</pubDate>
				<wikidot:authorName>tomas123</wikidot:authorName>				<wikidot:authorUserId>319652</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>on the white book are two ftp clients on board:</p> <div class="code"> <pre> <code>~ # /usr/bin/ftpget BusyBox v1.1.1 (2008.11.20-08:20+0000) multi-call binary Retrieve a remote file via FTP Usage: ftpget [options] remote-host local-file remote-file Options: -c,--continue Continue previous transfer -v,--verbose Verbose -u,--username Username -p,--password Password -P,--port Port number</code> </pre></div> <p>and for secure ftp (Port 22)</p> <div class="code"> <pre> <code>~ # /usr/bin/sftp usage: sftp [-1Cv] [-B buffer_size] [-b batchfile] [-F ssh_config] [-o ssh_option] [-P sftp_server_path] [-R num_requests] [-S program] [-s subsystem | sftp_server] host sftp [[user@]host[:file [file]]] sftp [[user@]host[:dir[/]]] sftp -b batchfile [user@]host</code> </pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://mybookworld.wikidot.com/forum/t-163766#post-513219</guid>
				<title>Re: FTP script</title>
				<link>http://mybookworld.wikidot.com/forum/t-163766/ftp-script#post-513219</link>
				<description></description>
				<pubDate>Fri, 19 Jun 2009 18:59:27 +0000</pubDate>
				<wikidot:authorName>frater</wikidot:authorName>				<wikidot:authorUserId>139187</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>vsftp is an FTP-server.<br /> You need an ftp-client…</p> <div class="code"> <pre> <code>ipkg install inetutils</code> </pre></div> <p>Yes, I think that code will work (although I didn't look at it in detail)<br /> If it doesn't you can try something like this:<br /> (I wrote this a long time ago and would do it more elegant now…)</p> <div class="code"> <pre> <code>FILE="4MB.zip" FTPU="user" FTPP="pass" FTPS="ftp.mirmana.com 31" ftp -v -n ${FTPS} &lt;&lt;EOF &gt;&gt;${TMPLOG} user ${FTPU} ${FTPP} binary get ${FILE} ${FILE}.bak put ${FILE} quit EOF</code> </pre></div> <p>It can even be done in windows…..</p> <div class="code"> <pre> <code>@ECHO OFF SET FTPS=89.250.176.48 SET USER=login SET PASSWORD=pass SET FTPDIR=. SET FILE=4MB.zip ECHO open %FTPS%&gt;%FTPS%.ftp ECHO %USER%&gt;&gt;%FTPS%.ftp ECHO %PASSWORD%&gt;&gt;%FTPS%.ftp ECHO BIN&gt;&gt;%FTPS%.ftp ECHO cd %FTPDIR%&gt;&gt;%FTPS%.ftp ECHO get %FILE%&gt;&gt;%FTPS%.ftp ECHO put %FILE% %FILE%.bk&gt;&gt;%FTPS%.ftp ECHO bye&gt;&gt;%FTPS%.ftp ftp -i -s:%FTPS%.ftp del /q %FILE% del /q %FTPS%.ftp pause</code> </pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://mybookworld.wikidot.com/forum/t-163766#post-513206</guid>
				<title>FTP script</title>
				<link>http://mybookworld.wikidot.com/forum/t-163766/ftp-script#post-513206</link>
				<description></description>
				<pubDate>Fri, 19 Jun 2009 18:40:41 +0000</pubDate>
				<wikidot:authorName>Creaky</wikidot:authorName>				<wikidot:authorUserId>326842</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I have the following script that I am trying to get to work, if its possible of course. When I run the script I get an error message which is</p> <div class="code"> <pre> <code>ftp: line 8: ftp: command not found</code> </pre></div> <p>Will this sort of thing actually work, and if so what else do I need to install. I have vsftpd installed and running and thought that would do the trick.</p> <div class="code"> <pre> <code>HOST="ftp.com" USER="backups" PASSWD="pass" DATE=$(date +"%Y-%m-%d") FILE="dbbackup_$DATE.sql.gz" ftp -n $HOST &lt;&lt;END_SCRIPT quote USER $USER quote PASS $PASSWD binary get $FILE quit</code> </pre></div> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>