Posts

Showing posts from November, 2010

Avoid uploading duplicated files in FTP using MSDOS script

I was uploading files using the script I made in a previous post, and all was working smoothly until I reach a directory full of images used for an address book application, there were about 2,000 files. The current version of the script made no comparison for file existence (actually it deletes the old file in the server before attempting to save the new one) or date comparison. In this case, and assuming those files change don’t change too often, I start thinking in a new process to remove the duplicated files and only upload the non existing files. I made a new FTP script to read the remote files and then delete the existing files from the local PC. This process is a dumb process and only task is to delete all files from the list. It is not aware of date changes or new file versions. Saying these, if you use this script, always work with a backup of your files, never with your original files as they might be deleted. The script usage is: deleteDuplicatedFiles.cmd <Root direc...

FTP Uploading files using MSDOS script

Recently I was working in a static Web Site and at the time I need to upload it to the server, I realize there were several files and directories to upload. As I’ve never been a big fan of FTP programs other than the command line provided in each OS, and, instead of searching if there were already a public solution, I started thinking in an automation script to upload the files. The basic idea of an automation script is to read the contents of a directory, create a commands script for FTP and then execute the generated script. But it also needs to be recursive within internal directories. As I was working with Windows, the script I created is for MS DOS The way to call it is: uploadfiles <Root directory to upload > Where the given root directory is where the desired files to upload are stored. Taking a little walkthrough of the script, it works like these: 1. Set working variables and defaults. set user= < set FTP User> set pass= < FTP Password > set site= < site ...