I think I can stop at 6. My backups aren't over a meg each, and they are weekly, so I have no issues with clearing out the old backups once a month by myself.
However, I have to ask whether this works with SFTP, or if there is something else I need to do. So far I haven't been able to get it to work. I deviated a little from your instructions, but only so that I can have everything in the same folder. I have the .bat and .txt. files in the same directory where the backups will go. My two files are BackupScript.bat and BackupInfo.txt. This is what they contain:
.bat:
cd /D D:\Start\Other\Website\Backups
ftp -s:D:\Start\Other\Website\Backups\BackupInfo.txt ftp. something.something.com:port (without the space after ftp.)
.txt:
<user>
<pass>
prompt
cd /var/www/siteroot/forums/admin/backups
mget *
bye
exit
So I must be doing something wrong, or SFTP does something different.
when you FTP into the server manually, what folder do you end up in? you may need to adjust the "cd" path in the txt to make it locate the correct folder using a path relative to where you land
if you open a command window and manually run the bat file (after remove the bye and exit lines from the txt) what message are you getting?
sftp may or may not be different, I am not sure.
Manually running it (by which I assume just typing what is in the bat file) results in the following (edited, of course):
Unknown host ftp. something.something.com:22.
ftp> <user>
Invalid command.
ftp> <pass>
Invalid command.
ftp> prompt
Interactive mode Off .
ftp> cd /var/www/siteroot/forums/admin/backups
Not connected.
ftp> mget *
Not connected.
ftp> bye
Not sure what you mean by your first question, though. When I FTP into the server through what? My usual program (FileZilla)? Because it's just whatever my last visited folder was from the last time I was using it.
well, you need to figure out the FTP connection part as something is wrong with either the host name or the port or your FTP app on your machine.
regarding the second part, there is usuallly a landing folder whenyou log in via FTP, based on your server setup and the account you are logging in with. Normally it goes to the root of your home folder for the account. once you can get the login to work, run an "ls" command to see where what folder you are in and then adjust the "cd" path to use relative path to your backup folder.
if you just type "ftp
ftp.something.something:22" into the command line, you get the unknown host? can you use an IP address of your server/account instead?
Nope, typing that doesn't work. Unknown host. However, the IP did something else. After pressing enter, my C:\> changed to ftp>
that means the host you entered in .bat file is incorrect or can not be resolved by your computer. using IP should be fine. Seeing the ftp> means that your are connected. If you still see that go ahead and type
bye
exit
then update the .bat file to use your IP address instead of the hostname and try running it again
Problem is, anything I type once it's at ftp> just tells me I'm not connected.
ctl-c to get our of it and then try again
enter at command prompt
ftp xxx.xxx.xxx.xxx
and then you should get prompted for username, then password. if you can log in like that, then type "ls" (no quotes) to see where you are.
type bye and exit to disconnect and quit ftp mode.
Already tried that. It changes from the directory> to ftp>, but there are no prompts. If I try to type my user name in anyway, it tells me I'm not connected.
you have a weird setup.
try the following
c:\> ftp
ftp> open <hostname> (or open <ip>)
you should get prompted for credentials. if not, then there may be some configuration issue with your server.