How to automate backup from Windows Server to ftp server
by Volker Weber
I am trying to create a daily backup of two relatively small but essential directories of a Windows 2003 Server using ftp. How would you solve this on Windows?
Scenario: 2 Servers
- Windows 2003 Server with access to the Internet, all incoming ports besides Terminal Service closed
- Linux Server on the Internet, all incoming ports besides FTP closed
Task: Create a daily full backup from two directories on server 1 to compressed archives on server 2. Archives should be named by date, like foo080714.zip and bar080714.zip.
How would you automate this?
Comments
Nero BackItUp can do FTP backups. :) I don't know about the other task requirements however, never used it myself expect when I had to help others who wanted to do something with the software.
How or with what? I believe SyncBack would do the job. There's been a tutorial on Lifehacker for the free version.
I was told rsync can do everything... or I'm wrong?
I would use the AT command to schedule a backup that runs something like this:
-- begin batch file --
@echo off &setlocal enableextensions
for /f "tokens=1-3 delims=./-" %%f in ("%date%") do (
set today_=%%h%%g%%f
set dd_=%%f
set mm_=%%g
set yyyy_=%%h)
echo %today_%
echo dd_=%dd_% mm_=%mm_% yyyy_=%yyyy_%
:: Insert youor backup routine here, using %today_%.ext as the filename to back up to
:: Insert your method of transferring files here
for %%v in (today_ dd_ mm_ yyyy_) do set %%v=
endlocal &goto :EOF
-- end batch file --
I'd be tempted to ditch FTP and use SSH for transfer. FTP is notoriously insecure, to say the least...
I'd use SSH as the transfer mechanism, get myself an SSH keyfile onto the Windows box and a copy of PSCP from the PuTTY project (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html), and upload the files there.
However, if you're dead set on transferring via FTP, you could amend the batch file to use echo statements to build a "transfer.txt" file that does the FTP open/transfer script, and contains the correct filename based on the environment variable %today_%. Just add the line "ftp
Bah! My answer got truncated!
I'll send you an email tonight, just in case. :-)
(Plus I can add corrections, and further information!)
Although not specifically about using FTP, this article suggests an interesting approach to this kind of off-site backup, which may be of interest => http://www.smallnetbuilder.com/content/view/30171/77/
create a schedule and use cmd line version of rar
then use ftp.exe with script (usualle dont work very well for x64) if x64 use filezilla
assuming security isnt a requirement
and if they are small use drivehq free for 1gb
I use SyncBack for similar tasks. I schedule the task to do date specific backups, but run it more than once per day. If a file has been omitted (e.g. network timeout) it would be updated.
Absolutely love it.
you can use opensource software, 7zip and filezilla or ftp.exe, look here for sample using 7zip and date:
http://dotnetfish.blogspot.com/2008/07/zip-ftp-database-for-backup-purposes.html
use Philip's to create the file
conent of vowe.txt
open ftp.vowe.somewhere
user vowe
this is not my pass
cd wheretoput
put file1
put file2
quit
ftp -s:vowe.text
if you need errorhandling you can use errorlevel to see the result
I have been using Cobian Backup for a couple of years and it has always worked perfectly.
Look at rsnapshot http://www.rsnapshot.org
"rsnapshot is a filesystem snapshot utility based on rsync. It makes it easy to make periodic snapshots of local machines, and remote machines over ssh. It uses hard links whenever possible, to greatly reduce the disk space required."
Is it just me or did you forget some kind of encrypton in this scenario?
Do you have shell access on the Linux server?
Get JungleDisk and automate it completely. Cross platform, uses Amazon S3 for storage, which is very reliable and dirt cheap.
+1 for JungleDisk. I’m using it for my off-site back-up needs, and it’s very nifty.
I second SyncBack - brilliant!
i would'nt do it with FTP (plain passwords, etc.)!! NO Way. But if so you could do it all within Windows Server itself.
- Task-Scheduler #1 packs the package or directory or whatever
- Task-Scheduler #2 does "ftp put" package.
- both Tasks could combiened with "Backup für Faule" Script from heise.de ;-)
- both Tasks can prepared in two Batchfiles:
pack.cmd: zip *.* > package.zip (short version of the comandline)
ftpcopy.cmd: ftp put package.zip
- run Batchfiles as sheduled Tasks on wich time you want.
the good point: you can see within the Eventviewer if the Backup was Ok or not... without paying any Software extra or so ;-)
Post a comment
Recent comments
Christian Tillmanns on Meeeeeeeeeeep at 08:41
Wolfgang Siebeck on Nokia Belle is available at 05:58
Ingo Martinz on Meeeeeeeeeeep at 22:32
Axel Koerv on Meeeeeeeeeeep at 21:57
Roland Dressler on Outlook to Notes converter: from PST to NSF at 11:50
Karl Heindel on Outlook to Notes converter: from PST to NSF at 10:30
Jerry Preissler on LibreOffice vs Apache OpenOffice at 13:47
Mariano Kamp on How to commit at 09:41
Bernd Vellguth on Outlook to Notes converter: from PST to NSF at 02:05
Thilo Hamberger on Outlook to Notes converter: from PST to NSF at 16:40
Jens Bruntt on Free PlayBook for your Android app submission at 11:47
Karl Heindel on Outlook to Notes converter: from PST to NSF at 20:26
Roland Dressler on Outlook to Notes converter: from PST to NSF at 15:12
Stephan H. Wissel on heise online: IBM plant Stellenabbau in Deutschland at 08:38
Jan Lauer on heise online: IBM plant Stellenabbau in Deutschland at 04:13
Juergen Heinrich on Balance at 03:29
Jörg Hermann on Girls On Longboards at 02:42
Stephan H. Wissel on heise online: IBM plant Stellenabbau in Deutschland at 23:21
Joerg Michael on heise online: IBM plant Stellenabbau in Deutschland at 21:01
Ben Poole on Outlook to Notes converter: from PST to NSF at 19:46
David Hablewitz on BlackBerry Business Cloud Services with Microsoft Office 365 at 16:44
Patrick Picard on RIM tries to be social. Falls flat on face. at 16:00
Volker Weber on Outlook to Notes converter: from PST to NSF at 10:29
Richard Hogan on Outlook to Notes converter: from PST to NSF at 10:26
Joachim Haydecker on Girls On Longboards at 08:26


