Indlela yokuDlulisa iifayile kwiLinux ngeSCP kunye neRsync

Kule tutorial siza kuchaza indlela yokusebenzisa i-SCP (ikopi ekhuselekileyo) kunye neRsync, imiyalelo emibini enokusetyenziselwa ukuhambisa iifayile phakathi koomatshini ababini.

Umzekelo, sinokukopa ifayile okanye isikhombisi ukusuka kwasekhaya ukuya kude okanye ukusuka kude ukuya kwiinkqubo zasekhaya.

Xa usebenzisa scp ukuhambisa iifayile, yonke into ibhalwe ngokufihlakeleyo ukuze iinkcukacha ezibuthathaka zingatyhileki.


Kule tutorial, sinika imizekelo yendlela yokusebenzisa scp kunye rsync imiyalelo yokuhambisa iifayile.



I-SCP (ikopi ekhuselekileyo)

scp ikopa iifayile phakathi kwenginginya kwinethiwekhi.


Isebenzisa ssh (1) kugqithiso lwedatha, kwaye isebenzisa ubunyani obufanayo kwaye inike ukhuseleko olufanayo ne-ssh (1).

I scp Umyalelo uxhomekeke | | + _ | yokuhambisa idatha, ke ngoko ifuna isitshixo ssh okanye ipaswedi ukungqinisisa kwiisistim ezikude.

Unokufunda ngakumbi ngendlela yokuseta amaqhosha e-ssh.

Is syntax ngokubanzi kunye nokusetyenziswa kwe ssh Ngu:


scp

scp [OPTION] [user@]local:]file1 [user@]remote:]file2 ibonelela ngeendlela ezininzi ezizizo ichazwe ngokubanzi .

Dlulisa iifayile ukusuka ekuhlaleni ziye kude kude ne-SCP

Ukukopa okanye ukuhambisa ifayile kumatshini wasekhaya ukuya kumatshini okude, sebenzisa lo myalelo ulandelayo:

scp

Phi:

  • umfanekiso.png ligama lefayile esifuna ukuyidlulisa ukusuka kwindawo esiya kuyo kude,
  • kude_igama lomsebenzisi ngumsebenzisi kwiseva ekude,
  • 10.10.0.1 idilesi ye-IP yomncedisi,
  • / kude / umkhombandlela yindlela eya kwisikhangeli esifuna ukukopa ifayile kuyo.

Phawula: Ukuba awuchazanga isikhombisi esikude, ifayile iya kukhutshelwa kulawulo lwasekhaya lomsebenzisi okude.


Xa ucinezela ukungena, uya kucelwa ukuba ufake ipassword yomsebenzisi ekude kwaye ugqithiselo luya kuqala.

Ukungenisa igama lefayile kwindawo ekuyiwa kuyo ikhuphela ifayile enegama loqobo. Ukuba ufuna ukugcina ifayile phantsi kwegama elahlukileyo kufuneka uchaze igama elitsha:

Umzekelo:

scp image.png remote_username@10.10.0.1:/remote/directory

Dlulisa iifayile ukusuka kude kude ne-SCP

Ukuhambisa ifayile ukusuka kumatshini okude ukuya kumatshini wakho wasekhaya, sebenzisa lo mthetho ulandelayo:


scp image1.png remote_username@10.10.0.1:/remote/directory/new_image.png

Dlulisa isikhombisi ngokuBuyayo ukusuka eLalini ukuya kude

Ukuhambisa isikhombisi kunye nakho konke okuqulathwe kumatshini wasekhaya ukuya kumamkeli okude, sebenzisa lo myalelo ulandelayo:

scp remote_username@10.10.0.1:/remote/directory/new_image.png /local/directory

QAPHELA: Oku kudala isikhombisi esingasasebenziyo ngaphakathi / kwendlela ke iifayile ziya kuba / kumendo / kumkhombandlela



Rsync

Njenge scp -rp sourcedirectory user@dest:/path , scp isetyenziselwa ukukopa iifayile nokuba ziye okanye zisuka kumamkeli okude, okanye kwalapha kumamkeli wangoku.

rsync isetyenziselwa ukuhambisa iifayile ezinkulu.


Dlulisa ifayile ukusuka eLalini iye kude neRsync

Ukukopa ifayile kumatshini wakho wasekhaya ukuya kumamkeli okude nge rsync, sebenzisa lo mthetho ulandelayo

rsynch

Isiphelo

Kule tutorial, ufunde indlela yokusebenzisa rsync -ave ssh mydirectory remote_user@10.10.0.2:/remote/directory/ kunye scp ukuyalela ukukopa iifayile kunye nemikhombandlela phakathi koomatshini ababini.