The Silly Software Company Silly Software Company
-=oOo=-


A poor man's way of doing things
is still a way to get things done

Use the internet for additional hard disk space using FTP under DOS

Every now and then you just wish you had a second computer. Say, you need a place to store some of your files somewhere else (because you want to format your hard disk and re-install Windows), or a save place to keep a backup of your windows registry while you mess with your system.. You don't have a tape drive or a CD-writer, and it's going to take ages to copy everything to diskettes.

If you have an internet account that also provides you with 'web space' i.e. a place to have your own web site, you have in fact some megabytes of disk space on another computer (your internet provider's server), and you can use your internet connection to store files there.
Usually, your provider has created a directory for your web site. With some providers, you explicitly need to request your free web space in order for a directory to be created for you.
Most providers don't want you to use your 'personal web space' as extra disk space, but if it's only very temporary, they will probably not notice that the files you put there are not web pages but a backup of your files.

Likewise, you can use this to transfer files from one computer to another : you upload files from one computer to the Internet server, then you make a connection from the 2nd computer to the internet server, and download the files again.

To do this you will use your internet connection, with your user name and password, so normally other people will not be able to get to your files, unless they know your user name and password, or have found a way to break in.

Transferring files over an internet connection goes fast and easy with FTP : File Transfer Protocol, an internet protocol especially designed for File transfer on the internet (or other networks running TCP/IP).

You can use an FTP program such as CuteFTP (shareware), but in case you do not have that installed on one of the computers you want to upload from or download to, it can be done in a DOS session as well. If you can connect your computer to the internet, you'll most likely be able to start an FTP session.

How to do it:

  1. connect to internet (using Windows dial-up networking, a DOS PPP dialer program, or whatever you normally use to get on the web)
  2. if you're using Windows, start a DOS session (DOS-prompt,; in Windows 9x you can find it from Start : Programs / MS-DOS prompt)
  3. to start an ftp session, type
    ftp
  4. let's assume you have an internet account with Yoohoo.com. Their FTP server is called ftp.yoohoo.com. Your username is Pete and your password is 3211. Your personal web directory is called 'my-site'? To log on to your internet provider's ftp server, type
    open ftp.yoohoo.com.

    enter your username and password when prompted to.
    When everything worked fine, you'll receive a message saying 'User Pete logged in'.
  5. the ftp server will probably have taken you to your own directory. If you have a web site, you can see a list of .*htm(l) and maybe *.gif, *.jpeg, . . . files when you type
    ls or dir
    if necessary, go to a specific directory by typing
    cd [directory name]. You are informed about which directory you're in (on the server) when you type pwd.
  6. to create a new directory for your backup files, type
    mkdir backup
  7. you can now upload the files you want to backup with one of the following commands
    put
    mput
    send

    click here for help : a list of FTP commands

  8. You can now close the connection, e.g. with
    bye

to download your files again,

establish an internet connection from the computer you want to download them to,

repeating steps 1 to 5.

  1. to go to your backup directory, type
    cd my-backup
  2. download the files with one of the following commands :
    get, mget, recv
    when you type get , you will be asked which remote files to get, then where to put them.
  3. close the connection (bye, quit, …)

Automate it

the FTP command can be used with a script, so that all these steps can be listed in a file, and then the command ftp -s:filename will execute all the commands listed in the file mentioned.

To add the list of files you want to backup/upload, this could be a time saver :

you can create a list of files n using the DIR command, from the DOS prompt

e.g. to list all files from the directory c:\user to a list in the temp directory, type

DIR c:\user /ON /B /L > %temp%\list.txt

you can then copy and paste this list of files into the ftp script, and add the command 'put' or in front of them. This technoque is discussed in more detail on the next page, where FTP is used to upload a complete web site.

as you probably will want to download all the files you've backed up, the same list can be used in the restore script.

An alternative would be to collect all the files you want to backup in one single .zip file, using a tool like winzip or pkzip. Pkzip also works under DOS. In this case it might be wise to also upload pkunzip.exe, so that you can still unzip your backup.

Please note that you can only upload from and download to your current directory, i.e. the folder you are in. The command 'lcd' (local change directory)can be used to navigate from one directory on the local machine (i.e. your computer) to another.

You can temporarily leave an ftp session with the command ! . You then start a dos session so you can do some additional work outside the ftp session, then close the DOS session (with 'exit') and return to the ftp session.


hosted by My DotCom