How to scp a file in 7600 using EEM/Tcl

Hello All,
I have a Tcl file on 7600 that produces a file, and I would like to copy this file to a server using scp.
This is how the file looks like :
::cisco::eem::event_register_none maxrun 240
#::cisco::eem::event_register_timer cron cron_entry "*/5 * * * *" maxrun 240
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
array set arr_einfo [ event_reqinfo ] ;
if [ catch {cli_open} rc ] {
       error $rc $errorInfo
} else {
       array set clifd $rc
set          filename          "IOS7600.dat_12345" ;
set     transfer        "copy disk0:/" ;        append transfer $filename ;     append  transfer " scp://username:password@ip:" ;
if [ catch {cli_exec $clifd(fd) $transfer} rc ] {
        error $rc $errorInfo
if [ catch {cli_close $clifd(fd) $clifd(tty_id)} rc ]  {
       error $rc $errorInfo
The problem is that scp: hangs ! Could you please help me to work-around this ? What am I doing wrong ?
Many Thanks.
Kind Regards,
Nikos

An alternative would be to write an applet, like :
event timer cron name PUSH-CoPP cron-entry "*/5 * * * *" maxrun 240
to do the following command :
set     transfer        "copy disk0:/" ;        append transfer $filename ;     append  transfer " scp://username:password@ip:" ;
but how can I provide the filename, I could use a regexp like :
*IOS7600*
and then answer the related to scp dialog using action statements.
Could you please help me with this please ?
Many Thanks.
Kind Regards,
Nikos

Similar Messages

  • How to upload Excel file in BI using function module in abap program

    How to upload Excel file in BI using function module in abap program?

    Hi Anuj,
    To upload the file , you can try a standard program "RSEPSFTP" .
    while you execute the program , a selection screen appears in which the inputs should be give as
    RFC destination - The target server name
    FTP command- PUT
    local file - your file name
    local directory - path of your local file
    remote file - your target file name
    remote directory - where it has to be stored
    Hope this is useful for you
    Thanks & regards
    Anju

  • How to upload a file into server using j2ee jsp and servlet with bean?

    How to upload a file into server using j2ee jsp and servlet with bean? Please give me the reference or url about how to do that. If related to struts is more suitable.
    Anyone help me please!

    u don't need j2ee and struts to do file uploading. An example is as such
    in JSP. u use the <input> file tag like
    <input type="file"....>You need a bean to capture the file contents like
    class FileUploadObj {
        private FormFile srcFile;
        private byte[] fileContent;
        // all the getter and setter methods
    }Then in the servlet, you process the file for uploading
        * The following loads the uploaded binary data into a byte Array.
        FileUploadObj form = new FileUploadObj();
        byte[] byteArr = null;
        if (form.signFile != null) {
            int filesize = form.srcFile.getFileSize();
            byteArr = new byte[filesize];
            ByteArrayInputStream bytein = new ByteArrayInputStream (form.srcFile.getFileData());
            bytein.read(byteArr);
            bytein.close();
            form.setFileContent(byteArr);
        // Write file content using Writer class into the destination file in the server.
        ...

  • How to extract .sit files(in MAC)  using java program

    Hi,
    please help me , i want to simple program for
    " how to extract .sit files(in MAC) using java program"
    that sit files same as zip files in windows..[                                                                                                                                                                                                                                                                                                                                   

    Thanks for reply...
    but i search in the google about this topic...there is no results will appear..
    the problem is "i have to run program in the MacOS like extract all the
    .sit(StuffIt) extension files. These sit files same as zip files in the windows... we have one tool called StuffIt Expander but it is 3rd party tool. but here requirement is i have to write my own program to extract all the files same as zip file program...
    please do the needful..i am waiting for ur reply,,,

  • How to transfer pc file to Samsung using the adobe reader app?

    how to transfer pc file to Samsung using the adobe reader app?

    I solved the problem.  I manually created my own Adobe PDF folder by connecting the phone via usb to my PC, Windows Autoplay gave me the option to 'Open device to view files'. Explorer then displayed all the folders on the phone.  I created an Adobe PDF folder manually and copied the PDFs I wanted to view into that folder.  Adobe Reader then found the files without a problem.  I clearly was missing something quite simple but something I'm sure a lot of people would miss.  Perhaps if the next version of Adobe Reader for Android created this folder automatically, like Kindle and Kobo and other readers do, it might save a lot of people a bit of a headache.

  • How to send multiple files in parallel using ftp with single connection

    Hi.
    i have written code for file upload manager using ftp..
    it perfectly working with sequence file uploading in single connection..
    And i tried to upload multiple files with parallel processing in a single connection.... but it is not working properly.. i also used thread concept
    but single file only transfered and connection refused...
    my code here...
    //////////////////// main class //////////////////////////////////////////
    ftp.connect();
    ftp.login();
    String [] archivos = new  String[100];
                                      File dir = new File("C:\\Files Uploading\\");
                                       archivos = dir.list();
                                       for (int s=0; s<archivos.length;s++)
         //Start Data Transfer Here
         new DataTransfer(archivos[s]).start();
                                       Thread.sleep(1000);
    /////////////////////// thread class ////////////////////////////////
    class DataTransfer extends Thread
          String FileName="";
          String LocalPath="",RemotePath="";
           public DataTransfer(String fname)
         FileName = fname;
         LocalPath = "C:\\Files Uploading\\" + FileName;
         RemotePath = FileName;
         System.out.println(LocalPath);          
            public void run()
                        System.out.println("DataTransfer Started");
         /File Transfer Here
         try
               FileInputStream input = new FileInputStream(LocalPath);
                               Ftp_Client.storeFile(RemotePath,input);
         System.out.println("Successfully sent : " + RemotePath);
         catch (Exception exc)
              System.out.println(exc.getMessage());
              System.out.println("DataTransfer Ended");
         }otherwise tell me any other alternate way

    And i tried to upload multiple files with
    parallel processing in a single connection....
    but it is not working properly.FTP isn't a multiplexing protocol. How could it work at all?

  • How to upload multiple files in Webdynpro using File upload Screen Element

    Hi Experts,
          Can anybody tell me how to upload multiple files/pdfs in webdynpro using file upload screen element, and also please tell me what is the maximum storage limit of RAWSTRING data type,Advance Thanks.
    Regards,
    Sandesh

    Hi Sandesh,
    this is simply not supported, not in WebDynpro nor in standard HTML.
    A workaround is to upload a ZIP with all files and on server side unpack the ZIP and operate on the single files.
    I hope it will  help u..
    ----------------------OR-------------------------
    As you know using File upload UI element we can upload only one file at a time. There may be a scenario where user may want to upload any no of files at a time which is not determined at design time. This can be acheived using the ACF UpDownload UI element which requires a security whiltelist to be created
    http://scn.sap.com/docs/DOC-2270
    ----------------------OR-------------------------
    You can use Table UI element.
    Regards,
    Deepak Singh

  • How to upload & Download file in Adf using Jdeveloper 11.1.2 ??

    Hi All,
    I have just started working on Oracle ADF, Thanks a lot guys for solving our queries.
    I'm using Jdeveloper 11.1.2, How to upload and download file in ADF..?
    I have seen couple links on net but none of them worked on jdeveloper 11.1.2......
    Please Help......

    Hi guys,
    I'm able to download file in ADF using af:fileDownloadActionListener.......
    does any one knows how to upload a file using ADF???

  • How to store any file in database using Forms? EVEN non OLE Compliant

    I have to store and retrieve any file (not only image and OLE compatilble file) in the database and retrieve it later without using Forms and email it using java stored procedure. How do I do that?
    I used OLE, but the problem with this is later when I retrieve it, some OLE specific control information is also retrieved, which means the data stored is not only pure data.
    In the forms, I just want to give the file name and it should store that file into the database as we do with READ_IMAGE_FILE. Is there any way of achieving this?
    Thank you.
    Bijay
    null

    Please refer to this link:
    http://www.dba-oracle.com/t_storing_insert_photo_pictures_tables.htm
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • How to open epub file in iBooks using ANE(iOS) ?

    hello,
    I tried to open epub file in iBooks using Native Extensions.
    But, AIR app has crashed when calling ANE method (following: OpenEpub).
    Have problems with how to access the epub file?
    Or another problem?
    MacOS:10.6.8
    Xcode:4.2
    FlashBulder:4.6
    FlexSDK:4.6.0(default bundle version)
    TestDevice:1st iPad (OS 5.0.1)
    iOSNativeCode(this code works on native iOS app):
    #import <UIKit/UIKit.h>
    FREObject OpenEpub(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[]){
        id delegate = [[UIApplication sharedApplication] delegate];
        UIWindow* window = [delegate window];
        UIButton* uiBtn = [[[UIButton alloc] init] retain];
        [window addSubview:uiBtn];
        NSString *fileToOpen = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"epub"];
        NSURL *url = [NSURL fileURLWithPath:fileToOpen];
        UIDocumentInteractionController *docController = [UIDocumentInteractionController interactionControllerWithURL:url];
        [docController presentOpenInMenuFromRect:CGRectZero inView:uiBtn animated:true];
        [docController retain];
         const char *str = "Success";
         FREObject retStr;
         FRENewObjectFromUTF8(strlen(str)+1, (const uint8_t *)str, &retStr);
         return retStr;
    ANE packaging directory:
    ane/
         extension.xml
         key.p12
         platform/
              iOS/
                   iOSNativeCode.a
                   library.swf
                   test.epub
    extension.xml
    <extension xmlns="http://ns.adobe.com/air/extension/3.1">
    ~~~~
    Thanks!

    hi, i can open epub in iBooks using ANE !
        UIWindow *keyWindow= [[UIApplication sharedApplication] keyWindow];
        UIViewController *mainController = [keyWindow rootViewController];
        NSString *epubFileName= [[NSBundle mainBundle] pathForResource:@"test01" ofType:@"epub"];
        [epubFileName retain];
        NSURL *url = [NSURL fileURLWithPath:epubFileName];
        [url retain];
        UIDocumentInteractionController *docController = [UIDocumentInteractionController interactionControllerWithURL:url];
        [docController retain];
        CGRect rectDocC = CGRectMake(800, 0, 0, 0);
        [docController presentOptionsMenuFromRect:rectDocC inView:mainController.view animated:YES];
    thanks!

  • How to convert xml file to xsl using java

    Hi all,
    I have an XML file with which i need to convert(transform) it to an xsl file using java.
    I am new to converting xml file to xslt.Please send me if u have code .
    Thanks in advance
    regards
    Ram

    You seem to be asking the wrong question. An XSL file can be used to transform an XML file, but transforming an XML into an XSL does not make sense. The API for running XSL transforms on the Java platform is described here:
    http://java.sun.com/javase/6/docs/api/javax/xml/transform/package-summary.html

  • How to remove ":"  in file name while using Variable substution

    Hi ALL
    I am using  file adapter and I what to create file name dynamically by acesssing PO number and time stamp from the payload using variable substution.
    But the problem is I am getting ":" in time stamp field value and it is not acceptable for file name .
    So could you please tell me a way that I can remove this ":" from that particular field value and create the file name dynamically.
    Note 1)Add Time stamp option will not help me as we require a time stamp of particular zone.
    2) Dynamic Configuration code is also not use full as I am using 1:n file creation

    >
    Prasanna Kumar wrote:
    > Hi ALL
    >
    > I am using  file adapter and I what to create file name dynamically by acesssing PO number and time stamp from the payload using variable substution.
    > But the problem is I am getting ":" in time stamp field value and it is not acceptable for file name .
    > So could you please tell me a way that I can remove this ":" from that particular field value and create the file name dynamically.
    >
    > Note 1)Add Time stamp option will not help me as we require a time stamp of particular zone.
    > 2) Dynamic Configuration code is also not use full as I am using 1:n file creation
    does the time stamp with the ":" a part of your output file?
    else use a replaceAll function in your mapping and replace the : with empty string then use the value in the variable substitution
    Another option is use the normal BPM for 1: N message flow. The use a simple java mapping that will introduce a dynamic configuration and you can create the file name as you want. the java mapping will be used in the flow of messages from BPM to target system.
    ref: /people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name

  • Kindly help me how to view html file in swing using jbutton

    hello..im a begginer at j2se language and im working on my school project..kindly help me how to view html files by clicking button at javax.swing..thanks

    Here you go:public class HTMLViewer implements Runnable, ActionListener
         public void run() {
              JFrame frame = new JFrame("View HTML");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JButton button = new JButton("Click me!");
              button.addActionListener(this);
              Container cp = frame.getContentPane();
              cp.add(button, BorderLayout.CENTER);
              frame.pack();
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
         public void actionPerformed(ActionEvent e) {
              if (Desktop.isDesktopSupported()) {
                   Desktop d = Desktop.getDesktop();
                   try {
                        d.browse(new URI("www.google.com"));
                   } catch (IOException ex) {
                        ex.printStackTrace();
                   } catch (URISyntaxException ex) {
                        ex.printStackTrace();
         public static void main(String[] args) {
              EventQueue.invokeLater(new HTMLViewer());
    }If that's not what you're looking for you need to ask more specific questions.

  • How can I change file encoding for use in Itunes?

    For instance, aiff to apple lossles files, or mp3 to apple lossless, or any other conversion. And which is best?

    I don't really understand some of the settings that you posted. Stereo and joint stereo are two different things, so you can't encode as both at the same time. For modern MP3 compression, joint stereo is usually preferred, because it allows the encoder to use fewer bits in encoding the stereo information, and it doesn't result in any perceptual losses in stereo imaging.
    48.000 kHz is pointless unless you are ripping from source material that is actually at that sample rate. Redbook-standard CD audio is at 44.100 kHz, so just stick with that (or better yet, leave the sample rate setting at "auto" so it will pick the setting that matches the source material you are ripping from).
    320 kbps is kind of overkill as well. Actually, if you want to rip to MP3, I would advise you to stay away from the iTunes encoder, because most listening tests indicate that it hasn't been updated much since the first versions of iTunes back in the late 1990s. It is no longer a modern encoder. Assuming that you are on a Mac, I suggest that you download the iTunes-LAME plugin (http://www.apple.com/downloads/macosx/ipod_itunes/ituneslameencoder.html), which allows you to encode tracks into the iTunes Music Library using the LAME MP3 encoder. LAME is an open-source encoder project that has been continuously developed over many years and has been heavily tested for transparency. The latest version (3.97b1) has been shown in listening tests to be almost the same quality as equivilent-bitrate AAC files.
    Once you download the iTunes-LAME plug-in, you can install the latest version of LAME by going to http://www.rarewares.org/mp3.html . Scroll down to "Encoders/decoders built using LAME 3.97 beta 1" and download "For Mac OS X." This is a Unix Executable file. To install it in the iTunes-LAME plugin, go to Your User Folder/Library/iTunes/Scripts. Right click on the iTunes-LAME application and select "Show Package Contents." Open the "Contents" folder that appears and then open the "Resources" folder. You should see a Unix Executable there titled "lame." Replace this file with the 3.97b1 Unix Executable that you downloaded. Now iTunes-LAME will encode with LAME v.3.97b1 instead of its default LAME build. 3.97b1 has some major improvements over earlier LAME versions, so even though this installation process may seem daunting for some people, it is well worth it.
    To use iTunes-LAME, you first select a CD or playlist from the Source list (the left-hand column) in iTunes. You then click on the Script menu (the little script icon) and select "Import with LAME...". iTunes-LAME opens, showing you a command line and an Import button. LAME encoding options are selected using command-line switches. Fortunately, there are variable bit-rate (VBR) presets that have been heavily tested for transparency, so you don't really need to know anything about the command line options. Just type in "-V 2 --vbr-new," which is one of the most heavily-tested presets, and hit the Import button. This results in variable bit rate files that usually average out to between 170 and 240 kbps, depending on the complexity of the source. For more information on the presets, see http://wiki.hydrogenaudio.org/index.php?title=LAME#RecommendedEncoderSettings
    The only major downside to using iTunes-LAME is that it cannot take advantage of iTunes' error correction option when ripping CDs. If you want error correction though, you can always just have iTunes rip to WAV first, and then convert those WAV files to MP3 using the iTunes-LAME plugin.
    Feel free to ask any more questions.

  • How to generate excel file as output using OWB

    Hi,
    I have a requirement to generate an excel file as output using OWB.
    I am trying for a direct approach to create excel files.
    Though I know that excel can be created from a .csv file, I am looking for a direct approach to generate excel file without involving any .csv to excel conversion externally.
    Regards,
    Sri

    so, we are trying to do it by the help of oracle heterogeneous services. In my opinion it is possible (it depends on feature of ODCB Excel driver)
    For more details look at thread (it is about MS SQL Server but maybe it helps)
    Oracle to SQL SERVER
    Regards,
    Oleg

Maybe you are looking for

  • Mini displayport to dual-Link DVI Adapter - flicker issue resolved

    I have a late 2013 Imac 27 inch and I had a 30"  Dell 3007wfp as my second monitor on the standard DVI adapter for a while at low resolution.  I finally got off my behind and bought the mini displayport to dual-Link DVI Adapter...  I was excited to s

  • Why does CS5 crash so often

    Hi All, CS5 (which I nought in a bundle with Adobe After Effects etc) crashed on me 7 times yesterday and twice today for no reason that I can think of. All the crashes have happened when I am performing different tasks and sometimes even when I'm sa

  • Datagrid lableFunction

    Is there any way of knowing what row a labelFunction function is currently working on, so <mx:DataGridColumn headerText="Total"  dataField="TOTAL_PRICE" labelFunction="calculateTotalPrice" editable="false" minWidth="50"/>             protected functi

  • Error code -69 when trying to sync laptop to ipod

    Hey there, I just got my nano (2nd gen) and first time it sync'd just fine. I bought some itunes and set up some podcasts and now everytime (5+) I connect the two I get: Attempting to copy to disk 'My Ipod' failed. An error code occured (-69). I've r

  • Configure 4+ MidTier - BI and Forms to an Infrastructure Server

    I need some information as to a possible setting/configuration which 'limits' the number of MidTier servers connecting to the Infrastructure Server. I have 6 MidTier servers and 4 are in a valid state. I noticed the OC4J components are not DOWN, so I