Como fazer backup de arquivos com apenas um sistema de recuperação mínimo?

1

Eu só tenho acesso ao meu vserver através de um sistema de recuperação mínimo sobre o ssh. Não tem scp ou ftp instalado. Existe uma maneira fácil de fazer backup dos arquivos, de preferência diretamente para um servidor FTP, mas para a minha máquina local também seria bom.

Talvez isso ajude a mostrar as capacidades do sistema de resgate:

uname -a
Linux customer-rescue-v5 2.6.38.1-GN-SMP_x86_64 #5 SMP Fri Apr 8 13:27:16 CEST 2011 x86_64 QEMU Virtual CPU version 0.14.1 GenuineIntel GNU/Linux
customer-rescue-v5 ~ # compgen -c
if
then
else
elif
fi
case
esac
for
select
while
until
do
done
in
function
time
{
}
!
[[
]]
.
:
[
alias
bg
bind
break
builtin
caller
cd
command
compgen
complete
continue
declare
dirs
disown
echo
enable
eval
exec
exit
export
false
fc
fg
getopts
hash
help
history
jobs
kill
let
local
logout
popd
printf
pushd
pwd
read
readonly
return
set
shift
shopt
source
suspend
test
times
trap
true
type
typeset
ulimit
umask
unalias
unset
wait
crond
dropbear
rmd160
sha256
sha384
sha512
backup-tar
addpart
update-pciids
backup.sh
biosdecode
delpart
dmidecode
dump-remind
hashalot
iconvconfig
locale-gen
lspci
memtester
mklost+found
nscd
ntpd
ntpdate
ownership
partx
pcimodules
readprofile
restore-tar
rmt
rpcinfo
setpci
tcpdump
tunelp
vpddecode
zdump
zic
install
crond
dropbear
rmd160
sha256
sha384
sha512
backup-tar
addpart
update-pciids
backup.sh
biosdecode
delpart
dmidecode
dump-remind
hashalot
iconvconfig
locale-gen
lspci
memtester
mklost+found
nscd
ntpd
ntpdate
ownership
partx
pcimodules
readprofile
restore-tar
rmt
rpcinfo
setpci
tcpdump
tunelp
vpddecode
zdump
zic
install
arping
awk
base64
basename
captoinfo
cat
chgrp
chmod
chown
chroot
cksum
comm
cp
cut
date
dbclient
dd
df
dir
dircolors
dirname
dropbearkey
du
echo
env
ex
expr
false
find
fuser
head
hostid
id
infotocap
jmacs
jpico
jstar
killall
last
less
link
ln
logname
ls
mkdir
mkfifo
mknod
mv
nano
nice
nohup
nslookup
oldfuser
passwd
pkill
printenv
pstree
ptx
pwd
readlink
reset
rjoe
rm
rmdir
rview
rvim
seq
sha224sum
shuf
sha256sum
sha384sum
sha512sum
sleep
snice
sort
split
ssh
stat
strings
stty
sync
tee
telnet
time
touch
tr
traceroute
true
tty
uname
uniq
unlink
vdir
vi
view
vimdiff
wc
wget
who
whoami
yes
bashbug
[
catchsegv
cal
compile_et
clear
col
colcrt
colrm
column
dropbearmulti
csplit
cytune
ddate
exuberant-ctags
expand
localedef
factor
fdformat
flock
fmt
fold
free
gencat
getconf
getent
getopt
hexdump
iconv
infocmp
ipcrm
ipcs
isosize
joe
join
ldd
lddlibc4
line
locale
ntp-keygen
logger
look
mcookie
md5sum
mk_cmds
mtrace
namei
nl
pcprofiledump
ntp-wait
ntpdc
ntpq
ntptime
ntptrace
od
paste
pathchk
pgrep
pg
pinky
pmap
pr
printf
pwdx
raw
rename
renice
rev
rlfe
rpcgen
rsync
screen
script
setfdprm
setsid
setterm
sha1sum
shred
skill
slabtop
sntp
sprof
sum
tac
tack
tail
tailf
termidx
test
tic
tickadj
tload
toe
top
tput
tset
tsort
tzselect
ul
unexpand
uptime
users
vim
vmstat
w
watch
whereis
write
xtrace
e2label
findfs
fsck.ext2
fsck.ext3
halt
hdparm
ifconfig
ifdown
ifup
init
insmod
klogd
logread
lsmod
mkfs.ext2
mkfs.ext3
modprobe
poweroff
reboot
rmmod
route
start-stop-daemon
swapoff
syslogd
udhcpc
badblocks
agetty
ctrlaltdel
blkid
blockdev
cfdisk
fsck.cramfs
debugfs
dumpe2fs
e2fsck
e2image
elvtune
fdisk
filefrag
fsck
iptables-restore
fsck.minix
hwclock
iptables
mkfs.bfs
mkfs
iptables-save
ldconfig
logsave
losetup
mke2fs
mkfs.ext4
mkfs.cramfs
mkfs.minix
mkswap
pivot_root
resize2fs
sfdisk
sln
swapon
sysctl
tune2fs
bunzip2
busybox.static
bzcat
bzcmp
bzegrep
bzfgrep
bzless
egrep
fgrep
gunzip
gzcat
hostname
ip
netstat
ping
rbash
rnano
run-parts
sed
sh
zcat
zcmp
zegrep
zfgrep
base64
arch
basename
busybox
bash
bb
bzip2recover
bzdiff
bzgrep
bzip2
dircolors
bzmore
cat
chattr
chgrp
chmod
chown
chroot
cksum
comm
cp
cut
date
dd
df
dir
sha224sum
dirname
dmesg
du
echo
env
expr
false
fuser
grep
gzexe
gzip
head
hostid
id
kill
killall
link
ln
logname
ls
lsattr
mkdir
mkfifo
mknod
more
mount
mv
nano
nice
nohup
oldfuser
printenv
ps
pstree
ptx
pwd
readlink
rm
rmdir
seq
sha256sum
sha384sum
sha512sum
shuf
sleep
sort
split
stat
stty
sync
tar
tee
touch
tr
true
tty
umount
uname
uniq
unlink
uuidgen
vdir
wc
who
whoami
yes
zdiff
zforce
zgrep
zless
zmore
znew
.ssh
install
    
por peq 05.02.2015 / 21:48

1 resposta

1
tar cvzf - file1 file2 dir1 dir2 | ssh user@remotesystem "cat > /big/partition/rescue.tgz"

seria minha preferência. Você pode até descompactar na hora:

tar cvzf - file1 file2 dir1 dir2 | ssh user@remotesystem "cd /big/partition; tar xvzfp -"

Mas como o fuero aponta, pode-se também

rsync -avz -e "ssh user@remotesystem" dir1 dir2 remotesystem:/big/

(meu rsync-fu não é tão bom, então é possível que o acima não seja perfeito). Mas você entendeu a ideia; ssh pode ser usado como o transporte do portador para qualquer número de coisas.

    
por 05.02.2015 / 21:50