Download directory structure from a TFTP server

Clash Royale CLAN TAG#URR8PPP
up vote
5
down vote
favorite
I need to download the complete directory structure from a TFTP server. Is there some simple way to do that? If that is not possible, than how could I download all files individually (provided I have a list of all files on the server)?
tftp
add a comment |Â
up vote
5
down vote
favorite
I need to download the complete directory structure from a TFTP server. Is there some simple way to do that? If that is not possible, than how could I download all files individually (provided I have a list of all files on the server)?
tftp
add a comment |Â
up vote
5
down vote
favorite
up vote
5
down vote
favorite
I need to download the complete directory structure from a TFTP server. Is there some simple way to do that? If that is not possible, than how could I download all files individually (provided I have a list of all files on the server)?
tftp
I need to download the complete directory structure from a TFTP server. Is there some simple way to do that? If that is not possible, than how could I download all files individually (provided I have a list of all files on the server)?
tftp
tftp
edited May 19 '13 at 21:44
vonbrand
14k22444
14k22444
asked May 19 '13 at 21:08
user1968963
93692345
93692345
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
6
down vote
accepted
You cannot list files or directories with TFTP. Read first paragraph of RFC 1350 - 1. Purpose. (or better yet, read the whole document.)
If you have a file list in say files.txt you can use expect, curl or other to automate a download. Simple example (as a starter) using curl:
tftpbatch:
#!/bin/bash
server="tftp://$2"
while IFS= read -r path; do
[[ "$path" =~ ^ *$ ]] && continue
dir="$(dirname "$path")"
printf "GET %s => %sn" "$path" "$dir"
! [ -d "$dir" ] && mkdir -p "$dir"
curl -o "$path" "$server/$path"
done < "$1"
Run with:
./tftpbatch files.txt "10.0.0.5:69"
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
accepted
You cannot list files or directories with TFTP. Read first paragraph of RFC 1350 - 1. Purpose. (or better yet, read the whole document.)
If you have a file list in say files.txt you can use expect, curl or other to automate a download. Simple example (as a starter) using curl:
tftpbatch:
#!/bin/bash
server="tftp://$2"
while IFS= read -r path; do
[[ "$path" =~ ^ *$ ]] && continue
dir="$(dirname "$path")"
printf "GET %s => %sn" "$path" "$dir"
! [ -d "$dir" ] && mkdir -p "$dir"
curl -o "$path" "$server/$path"
done < "$1"
Run with:
./tftpbatch files.txt "10.0.0.5:69"
add a comment |Â
up vote
6
down vote
accepted
You cannot list files or directories with TFTP. Read first paragraph of RFC 1350 - 1. Purpose. (or better yet, read the whole document.)
If you have a file list in say files.txt you can use expect, curl or other to automate a download. Simple example (as a starter) using curl:
tftpbatch:
#!/bin/bash
server="tftp://$2"
while IFS= read -r path; do
[[ "$path" =~ ^ *$ ]] && continue
dir="$(dirname "$path")"
printf "GET %s => %sn" "$path" "$dir"
! [ -d "$dir" ] && mkdir -p "$dir"
curl -o "$path" "$server/$path"
done < "$1"
Run with:
./tftpbatch files.txt "10.0.0.5:69"
add a comment |Â
up vote
6
down vote
accepted
up vote
6
down vote
accepted
You cannot list files or directories with TFTP. Read first paragraph of RFC 1350 - 1. Purpose. (or better yet, read the whole document.)
If you have a file list in say files.txt you can use expect, curl or other to automate a download. Simple example (as a starter) using curl:
tftpbatch:
#!/bin/bash
server="tftp://$2"
while IFS= read -r path; do
[[ "$path" =~ ^ *$ ]] && continue
dir="$(dirname "$path")"
printf "GET %s => %sn" "$path" "$dir"
! [ -d "$dir" ] && mkdir -p "$dir"
curl -o "$path" "$server/$path"
done < "$1"
Run with:
./tftpbatch files.txt "10.0.0.5:69"
You cannot list files or directories with TFTP. Read first paragraph of RFC 1350 - 1. Purpose. (or better yet, read the whole document.)
If you have a file list in say files.txt you can use expect, curl or other to automate a download. Simple example (as a starter) using curl:
tftpbatch:
#!/bin/bash
server="tftp://$2"
while IFS= read -r path; do
[[ "$path" =~ ^ *$ ]] && continue
dir="$(dirname "$path")"
printf "GET %s => %sn" "$path" "$dir"
! [ -d "$dir" ] && mkdir -p "$dir"
curl -o "$path" "$server/$path"
done < "$1"
Run with:
./tftpbatch files.txt "10.0.0.5:69"
edited 31 mins ago
evandrix
10514
10514
answered May 20 '13 at 4:53
Runium
17.7k42859
17.7k42859
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f76400%2fdownload-directory-structure-from-a-tftp-server%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password