Subversion Repositories SmartDukaan

Rev

Rev 6848 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6848 Rev 6885
Line 21... Line 21...
21
    	
21
    	
22
        	List<String> ips = Arrays.asList((ConfigClient.getClient().get("ips_for_banner_uploading")).split(" "));
22
        	List<String> ips = Arrays.asList((ConfigClient.getClient().get("ips_for_banner_uploading")).split(" "));
23
        	if ( !(ips.get(0).equalsIgnoreCase("NA"))){
23
        	if ( !(ips.get(0).equalsIgnoreCase("NA"))){
24
        		keyFile= ConfigClient.getClient().get("secret_key_file");
24
        		keyFile= ConfigClient.getClient().get("secret_key_file");
25
	        	for(int i=0;i<ips.size();i+=1){
25
	        	for(int i=0;i<ips.size();i+=1){
-
 
26
	        		log.info("ip:"+ips.get(i)+":i:"+i+":secret_key_file:"+keyFile);
26
	                Scp scp = new Scp();
27
	                Scp scp = new Scp();
27
	                scp.setFile(localFilePath);
28
	                scp.setFile(localFilePath);
28
	                log.info("Banner Uploading paths Local Path: "+localFilePath+"Remote Path :"+remoteFilePath);
29
	                log.info("Banner Uploading paths Local Path: "+localFilePath+"Remote Path :"+remoteFilePath);
29
	                scp.setKeyfile(keyFile);
30
	                scp.setKeyfile(keyFile);
30
	                scp.setRemoteTodir("root: @"+ips.get(i)+":"+remoteFilePath);
31
	                scp.setRemoteTodir("root: @"+ips.get(i)+":"+remoteFilePath);
31
	                scp.setProject(new Project());
32
	                scp.setProject(new Project());
32
	                scp.setTrust(true);
33
	                scp.setTrust(true);
33
	                scp.execute();
34
	                scp.execute();
-
 
35
	                log.info("Scp executed on IP:"+ips.get(i));
34
	        	}
36
	        	}
35
        	}
37
        	}
36
    		/*Scp scp = new Scp();
38
    		/*Scp scp = new Scp();
37
            scp.setFile(localFilePath);
39
            scp.setFile(localFilePath);
38
            log.info(localFilePath);
40
            log.info(localFilePath);
Line 46... Line 48...
46
        	
48
        	
47
		} 
49
		} 
48
 
50
 
49
    public static void main(String[] args) throws ConfigException {
51
    public static void main(String[] args) throws ConfigException {
50
    	ScpService scp = new ScpService();
52
    	ScpService scp = new ScpService();
51
        scp.scpFile("/root/banner1.jpg", "/home/phani/Desktop/banner1.jpg");
53
        scp.scpFile("/var/lib/tomcat6/webapps/export/banners/banner1.jpg", "/var/lib/tomcat6/webapps/export/banners/banner1.jpg");
52
    }
54
    }
53
 
55
 
54
}
56
}
55
57