Jump to content
php.lv forumi

Lejuplādēt failu caur ssh


shurix

Recommended Posts

Labvakar.

Esmu saskāries ar lietu ko vēl nekad neesmu veidojis. Ir nepieciešams no mana servera kur ir php5 ielogoties citā serverī caur ssh, lejuplādēt visu mapes saturu un pēc tam mapi iztīrīt tukšu. Ar php tas vispar ir iespējams? Būšu pateicīgs par jebkādu info. Paldies.

Link to comment
Share on other sites

ftp neder?

 

/usr/bin/sftp -b /var/sftp_batch [email protected]

 

/var/sftp_batch saturs:

get /celsh/uz/mapi/remote/serverii/*.* /cels/uz/kurieni/lokaalajaa_serverii/

 

 

lai izdzeestu:

ssh [email protected] "rm -rf /celsh/uz/mapi/remote/serverii/*.*"

 

P.S autorizaacija remote serverii notiek ar sertifikātiem.

 

ar php būs:

 

exec('/usr/bin/sftp -b /var/sftp_batch [email protected]');
exec('ssh [email protected] "rm -rf /celsh/uz/mapi/remote/serverii/*.*"');

Edited by Klez
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...