This setup provides a fast way to copy files between different computers.
Hi,
today seiichiro0185 and I have found a fast and unusual way to copy files.
Warranty
Security issue
Security issue
Dependencies:
#!/bin/bash # directory all files and folders will be copied into basedir="/<any base directory>/" read filename echo "$filename" >&2 if [[ "${filename}" =~ / ]] then [ -d "${basedir}/${filename%%/*}" ] || mkdir -p "${basedir}/${filename%%/*}" fi cat - > "${basedir}/${filename}"
ncat -lkvnp 3334 --recv-only -e /path/to/your/recv-file.sh
Now the server is running and listening on port 3334. All files and directories are created with permissions of the running ncat.
#!/bin/bash host="$1" port="$2" [[ ${port} =~ ^[0-9][0-9]*$ ]] || { echo "The given port $port (2. argument) is not valid." >&2 && exit 1 ; } shift 2 IFS="," for f in $@ do { echo "${f}" && cat "${f}" ; } | ncat -i1 $host $port done
bash send-file.sh <host> <port> <file1>,<file2>,..,<fileN>