Ghost-Turk Posted August 3, 2010 Share Posted August 3, 2010 Mrb Arkadaşlar umarım yardımcı olabilirsiniz. Benim yapmak istediğim şey C:\WINDOWS\system32\dhcp\ dizini içindeki DhcpSrvLog-Fri.log, DhcpSrvLog-Sat.log şeklindeki gün gün dosyaları networkdeki linux sunucu içine, ilgili güne ait log dosyasını gece saat 24:00 da backup almak istiyorum. Bu sürekli çalışacak. Linux sunucuta kullanıcı adı ve şifresi ile login olunarak sftp gibi dosya aktarımları ile gönderilebilir. Nasıl yapabilirim... Teşekkür Ederim... Link to comment Share on other sites More sharing options...
Bultar Posted August 3, 2010 Share Posted August 3, 2010 Bir bat dosyası ve zamanlaşmış görevler yardımıyla rahatlıkla yapılabilir ? Link to comment Share on other sites More sharing options...
Ghost-Turk Posted August 3, 2010 Author Share Posted August 3, 2010 Bir bat dosyası ve zamanlaşmış görevler yardımıyla rahatlıkla yapılabilir ? Teşşekkür Ederim Rica etsem örnek bir bat dosyası yapabilir misiniz? Link to comment Share on other sites More sharing options...
MostWanted Posted August 3, 2010 Share Posted August 3, 2010 Autoit için #include <FTPEx.au3> $server = 'serverismi' $username = 'kullaniciadi' $pass = 'sifre' $Open = _FTP_Open('MyFTP') $Conn = _FTP_Connect($Open, $server, $username, $pass) $Ftpp = _Ftp_FilePut($Conn,"atılacak dosyanın dizini","ftpdeki dizin") $Ftpc = _FTP_Close($Open) Link to comment Share on other sites More sharing options...
Ghost-Turk Posted August 3, 2010 Author Share Posted August 3, 2010 Autoit için #include <FTPEx.au3> $server = 'serverismi' $username = 'kullaniciadi' $pass = 'sifre' $Open = _FTP_Open('MyFTP') $Conn = _FTP_Connect($Open, $server, $username, $pass) $Ftpp = _Ftp_FilePut($Conn,"atılacak dosyanın dizini","ftpdeki dizin") $Ftpc = _FTP_Close($Open) Hocam Teşekkür Ederim ancak maalesef olmadı. Sisteme giriş yaparken sonra sertifika sorar, normalde windows dan linux a bir dosya atmak için de sftp ile gönderebiliryoruz. Aslında bir ftp sunucu kurulu değil sistemde sadece windowsdn dosya atabilmek için 3 party sftp programlarla linux dosya dizinine bağlanıp istediğimiz dosyaları atabiliyoruz. 3 party programla da bağlanırken sertifika soruyor. Link to comment Share on other sites More sharing options...
MostWanted Posted August 3, 2010 Share Posted August 3, 2010 Benim sunucumda Linux fakat çalışıyor?Sen bir hata yapmış olmayasın.. Link to comment Share on other sites More sharing options...
blue_life Posted August 3, 2010 Share Posted August 3, 2010 Bende bir linux serverde denedim herangi bir sorun yok! #include <FTPEx.au3> Global $LocalFile = "C:\boot.ini" ; Yerel dosya konumu (\) Global $Remote_File = "httpdocs/boot.ini" ;Uzak dosya konumu (/) Global $server = 'www.test.com' ;Site adı $username = 'kullanıcı' ; Kullanıcı adı $pass = 'Sifre' ;Sire $Open = _FTP_Open('MyFTP') $Conn = _FTP_Connect($Open, $server, $username, $pass) $Ftpp = _Ftp_FilePut($Conn,$LocalFile,$Remote_File) $Ftpc = _FTP_Close($Open) Link to comment Share on other sites More sharing options...
Ghost-Turk Posted August 4, 2010 Author Share Posted August 4, 2010 Bende bir linux serverde denedim herangi bir sorun yok! #include <FTPEx.au3> Global $LocalFile = "C:\boot.ini" ; Yerel dosya konumu (\) Global $Remote_File = "httpdocs/boot.ini" ;Uzak dosya konumu (/) Global $server = 'www.test.com' ;Site adı $username = 'kullanıcı' ; Kullanıcı adı $pass = 'Sifre' ;Sire $Open = _FTP_Open('MyFTP') $Conn = _FTP_Connect($Open, $server, $username, $pass) $Ftpp = _Ftp_FilePut($Conn,$LocalFile,$Remote_File) $Ftpc = _FTP_Close($Open) Loglara baktım Aug 4 19:24:44 bayi proftpd[5269]: bayi.***.com.tr (::ffff:172.16.1.105[::ffff:172.16.1.105]) - SECURITY VIOLATION: root login attempted. Aug 4 19:24:44 bayi proftpd[5269]: bayi.***.com.tr (::ffff:172.16.1.105[::ffff:172.16.1.105]) - FTP session closed. Hatasını Alıyorum. Script aşağıdaki gibi editledim yanlış yaptığım yer neresi. #include <FTPEx.au3> Global $LocalFile = "D:\dosya" ; Yerel dosya konumu (\) Global $Remote_File = "/root" ;Uzak dosya konumu (/) Global $server = '172.16.1.253' ;Site adı $username = 'root' ; Kullanıcı adı $pass = '******' ;Sire $Open = _FTP_Open('MyFTP') Burayı ('172.16.1.253') Denedim $Conn = _FTP_Connect($Open, $server, $username, $pass) $Ftpp = _Ftp_FilePut($Conn,$LocalFile,$Remote_File) $Ftpc = _FTP_Close($Open) Yardımlarınız İçin Teşekkür ederim... Link to comment Share on other sites More sharing options...
MostWanted Posted August 4, 2010 Share Posted August 4, 2010 $remote file yerinde klasör göstermeyeceksin dosya göstereceksin.Ayrıca sitene atacaksan /public_html dizinini kullanacan sonuna da yine o dosya ismini ekleyeceksin.Aşağıdaki gibi.. #include <FTPEx.au3> Global $LocalFile = "D:\dosya\test.txt" ; Yerel dosya konumu (\) Global $Remote_File = "/public_html/test.txt" ;Uzak dosya konumu (/) Global $server = '172.16.1.253' ;Site adı $username = 'root' ; Kullanıcı adı $pass = '******' ;Sire $Open = _FTP_Open('MyFTP') Burayı ('172.16.1.253') Denedim $Conn = _FTP_Connect($Open, $server, $username, $pass) $Ftpp = _Ftp_FilePut($Conn,$LocalFile,$Remote_File) $Ftpc = _FTP_Close($Open) Link to comment Share on other sites More sharing options...
Ghost-Turk Posted August 4, 2010 Author Share Posted August 4, 2010 $remote file yerinde klasör göstermeyeceksin dosya göstereceksin.Ayrıca sitene atacaksan /public_html dizinini kullanacan sonuna da yine o dosya ismini ekleyeceksin.Aşağıdaki gibi.. #include <FTPEx.au3> Global $LocalFile = "D:\dosya\test.txt" ; Yerel dosya konumu (\) Global $Remote_File = "/public_html/test.txt" ;Uzak dosya konumu (/) Global $server = '172.16.1.253' ;Site adı $username = 'root' ; Kullanıcı adı $pass = '******' ;Sire $Open = _FTP_Open('MyFTP') Burayı ('172.16.1.253') Denedim $Conn = _FTP_Connect($Open, $server, $username, $pass) $Ftpp = _Ftp_FilePut($Conn,$LocalFile,$Remote_File) $Ftpc = _FTP_Close($Open) Hocam ilginiz için teşşekkür ederim ancak yine yetkisiz giriş hatası alıyorum. Aug 4 19:53:49 bayi proftpd[5855]: bayi.xxx.com.tr (::ffff:172.16.1.105[::ffff:172.16.1.105]) - SECURITY VIOLATION: root login attempted. Aug 4 19:53:49 bayi proftpd[5855]: bayi.xxx.com.tr (::ffff:172.16.1.105[::ffff:172.16.1.105]) - mod_delay/0.5: delaying for 4 usecs Aug 4 19:53:49 bayi proftpd[5855]: bayi.xxx.com.tr (::ffff:172.16.1.105[::ffff:172.16.1.105]) - FTP session closed. Scripti dediğiniz gibi de editledim ancak yine olmadı. Bu bir site değil amacım 2003 sunucuda ki dhcp loglarını ilgili gün geldiğinde linux içerisindeki dizine almak. Bu arada sistem CentOS Baştada söylediğim gibi putty ve ya başka bir sistemle bağlanırken sertifika soruyor. Sanırım sertifikaya takılıyor. #include <FTPEx.au3> Global $LocalFile = "D:\dhcp.log" ; Yerel dosya konumu (\) Global $Remote_File = "/root/Dhcp/dhcp.log" ;Uzak dosya konumu (/) Global $server = '172.16.1.253' ;Site adı $username = 'root' ; Kullanıcı adı $pass = 'parola' ;Sire $Open = _FTP_Open('172.16.1.253') $Conn = _FTP_Connect($Open, $server, $username, $pass) $Ftpp = _Ftp_FilePut($Conn,$LocalFile,$Remote_File) $Ftpc = _FTP_Close($Open) Link to comment Share on other sites More sharing options...
Ghost-Turk Posted August 12, 2010 Author Share Posted August 12, 2010 Arkadaşlar yardımlarınız için teşekkürler. Aşağıdaki şekilde sorunumu çözüdüm. Biraz amatörce bir script oldu ama çalışıyor. Yardımcı program olarak da psftp kullandım. Çünkü ssh üzerinden login olup dosya göndermem gerekiyordu. Zamanlanmış görevlere atadım. oturum açıkken çalışıyor. oturum beklemede iken arka planda kalıyor tek sorunum burası bu konuda yardımlarınıza ihtiyacım var pencereyi nasıl aktif ederim. winactive denedim olmadı. Bunu daha prfosyonel nasıl yazarım bilmiyorum. Örn; Şifreyi gizlemek. programı scritp in içine gömmek.( yani c:\ altından değilde otomatik olarak açıldığında bu exe yi çalıştıracak ve aşağıdaki işlemleri yapacak.) Run("C:\psftp.exe") WinWaitActive("C:\psftp.exe") send("open{space}172.16.1.200{enter}") send("root{enter}") send("parola{SHIFTDOWN}1{SHIFTUP}.{enter}") send("cd{SPACE}{SHIFTDOWN}7{SHIFTUP}var{SHIFTDOWN}7{SHIFTUP}log{SHIFTDOWN}7{SHIFTUP}dhcp{SHIFTDOWN}7{SHIFTUP}{ENTER}") send("put{space}c{shiftdown}.{shiftup}{altdown}\{altup}WINDOWS{altdown}\{altup}system32{altdown}\{altup}dhcp{altdown}\{altup}DhcpSrvLog-Wed.log{enter}") send("bye{enter}") Teşekkür Ederim... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.