Friday, March 17, 2006

UploadTo Shell Script

by damonp on March 17, 2006

in Snippets

Try this quick upload-to shell script to easily upload files to any server running an ssh daemon.

Create a new shell script called uploadto_hostname.sh with the following two lines:

[code]#!/bin/bash
scp $@ username@host.domain.com:

Set username and host.domain.com. Create one for every frequently used server.

To use simply pass the name of the file(s) to be uploaded:

# uploadto_myserver.sh file1 file2 file3

If you are using secure key authentication, you won't even need a password!

Popularity: 1%

{ 0 comments }