🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.unix.shell
1 messages
1 total messages Started by Michael Prusynski Wed, 17 Oct 1990 21:39
Re: transferring multiple files via cu (was: Sounds trivial...)
#1514
Author: Michael Prusynski
Date: Wed, 17 Oct 1990 21:39
56 lines
2554 bytes
In a previous article sean@utoday.UUCP (Sean Fulton) writes:

>We use a shell script and UUCP to do an automated ascii upload to a
>publishing system that is pretty void of any knowledge of
>communications with the outside world.

>At any rate, we have a /bin/sh script that basically does:
>	cu sysname <FILE
>Where FILE is of the form:
>
>~!/bin/slp10 	 			#wait 10 seconds
>piles of data to be uploaded
>~!/bin/slp10				#wait another 10 seconds
>~.					#Hangup the telephone.

>This has been somewhat reliable, but only allows for one file
>per call. Given that there is a modem shortage on the remote end, this
>is unacceptable.

>So, does anyone have any ideas on how to do something like:
>
>~!for a in `ls files`
>... etc.


If the remote system is a Unix system with tar you can save the output
of tar in a file via:  tar -cvf outputfile sourcepath
Then transfer it and untar it on the remote system, which preserves the
dates of the files.  Sounds simple, BUT THERE IS A COMPLICATION:
because "outputfile" contains NULLs, in order to transfer it with cu,
you have to ASCIIfy it (preferably with uuencode), then transfer it,
unASCIIfy it (uudecode), then untar it.
The computers must have tar and uuen/decode, and you have to remember
how to use them, and remember to remove the uu and tar files.
Here is my "tar+encode" shell script to try to keep it all rememberable.
---------- cut here ----------
: 'This program uses tar to transfer more than one file to remote host via cu
: It tars up a directory of files and then uuencodes them because tarfiles
: contain NULLs and will not transfer via cu  (Michael Prusynski - Sep. 1990)'
PATH=/bin:$PATH

case $1 in
	"") echo "usage:  $0 {source_path} [dest_path] "; exit 1;;
esac
dest=$$
case $2 in
	"") ;;
	*) dest=$2 ;;
esac
sh -cx "tar -cvf $dest.tar $1"
sh -cx "uuencode $dest.tar $dest.tar > $dest.uu"
echo "
file: $dest.uu is ready for transfer to remote host.
When transfer is done, type:  uudecode $dest.uu
                  then type:  tar -xvf $dest.tar
Remove $dest.tar and $dest.uu on both hosts when done."
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads