Shell script ftp

Hi
My ext 4tb (2x2TB raid 0) failed this week. HDD 2 failed to be more specific.
Ive managed to get some functionality back but cant get into the file structure
I was hoping to see if I could get in via shell script. Nopt used this before but given I could loose 3tb of movies and music I will try anything...
Anyone have any gidance on using shell script to access an external network drive?
I can ftp to the drive.
Si

Hi Friend,
Can you check this link  will help you some extend : [FTP open file;
Regards,

Similar Messages

  • Shell Script FTP Login

    Hi,
    I want to call a shell script ftp to connect to a server, below the code of my file:
    ftp -n <<BODY
    open 172.30.10.XXX
    user SAP SAP
    pwd
    bye
    BODY
    when i run the script with function SXPG_COMMAND_EXECUTE and and command name Z_SH, return code is Not connected.#
    The script can't login.
    Anypone could help me.
    Thanks and regards.
    Eduardo Paiva

    Hi Friend,
    Can you check this link  will help you some extend : [FTP open file;
    Regards,

  • FTP Problem Shell Script

    Hi ..
    Every Month we are trying to send file to the user ..
    This is my shell script
    ftp -n <<EOF
    verbose on
    open 10.11.22.10
    user cg11118 fsetftp
    ascii
    cd
    put SHR.DE93C.ACCENT.GRP624FA 'SHR.DE93C.ACCENT.GRP624FA'
    bye
    Here is the Log file for the run
    ==========================Start FTP ======================
    Fri Feb 29 17:30:23 CST 2008
    Verbose mode on.
    Connected to 10.11.22.10
    220-FTPD1 IBM FTP CS V1R6 at VS04, 23:26:26 on 2008-02-29.
    220 Connection will close if idle for more than 60 minutes.
    Remote system type is MVS.
    331 Send password please.
    230 CG11118 is logged on. Working directory is "CG11118.".
    200 Representation type is Ascii NonPrint
    (remote-directory) 250 "CG11118.PUT." is the working directory name prefix.
    221 Quit command received. Goodbye.
    ==========================End FTP ========================
    everymonth we are having problem that file is not going ..
    my first question is
    1) how to know whether file is sent to the user or not ?
    2) is there any problem with the script
    can anyone help me in resolving this issue pls ..
    Thanks in advance
    Dev Kishore

    I have never found the ftp(1) program to be really useful in a batch environment. Usually a quick and dirty shell script just makes too many assumptions about what the other host is sending and unreliable operations result.
    Instead of using the stock ftp(1) tool, look into the curl(1) tool for this. It can send to any system supporting the FTP protocol (or using several other protocols as well) and is much easier to use in scripting. Curl(1) is designed for use in scripts, unlike the original ftp(1) tool.
    HTH

  • Shell Script- To FTP the latest file with the date stamp

    I have a Solaris 10 based system, where it generate some application files (multiple) in XML format and the file name comprises of the current date.
    File Format is as follows;
    CX-FIL-20070624000000-2-8452536d-000133.xml
    Where 20070624 repesents the curent date of the file
    I want to FTP these files to another server (Solaris 10 based Sun Machine) by comparing the file name with the current date.
    Please let me know how I can do this by using a shell script.

    Assuming you want to ftp the files with today's datestamp, you could match the files you want like so:
    CX-FIL-`/bin/date +"%Y%m%d"`*
    Use that in your script to generate the file list to be transferred...
    -Rob

  • Ftp in unix shell script

    hi.
    I have the following requirement to be written as a shell script.
    1. ftp to another server ( say x)
    2. change the directory ( cd /data)
    3. check if there exists a file with extention .csv. If it does,
    3.1 get the file and copy it to a backup directory,
    3.2 rename the file to test.csv
    3.3 login to an oracle schema and execute a procedure.
    3.4. Based on the output, echo success or error
    3.5 If success delete the file
    Can all this be done in one script. ?
    Any help would be highly appreciated.
    Thanx

    Hi ,
    Hope the folllowing scipt listing will help you.
    cd /u01/backup/
    ftp -in << EOF
    open x
    cd data
    ls . /u01/backup/test.out
    EOF
    # Check whether .csv file exists.
    cat /u01/backup/test.out | awk '{print $9}' | tail +2 | cut -d "." -f 2 | grep csv
    if [ $? -eq 0 ]
    then
    cd /u01/backup/
    ftp -in << EOF
    open x
    cd data
    get
    EOF
    fi
    # renaming file
    cd /u01/backup/
    mv *.csv test.csv
    # set environment for database running
    export ORACLE_HOME=
    $ORACLE_HOME/sqlplus/bin -s /nolog << EOF > /dev/null
    connect user/pass
    spool output.lst
    @execute_the_script.sql
    spool off
    EOF
    ## procees output.lst and echo the result.
    ## Execute further steps..
    Regards,
    Aditya.

  • FTP command in shell script

    Hello All,
    I would like to transfer a file from one system to another system.
    so i haven written shell script with ftp command as follows.
    ftp -i 10.14.12.1<< END
    cd C:\Temp
    put $datafile
    ascii
    quit
    But i am getting error.
    Please let me know the sysntax followed by me is correct or thar remote system is down,
    Many thanks,
    Kumar.

    The ftp(1) command is not well-suited for scripting. Instead us the curl(1) tool:
    curl -T myfile ftp://ftp.some.where/down/in/this/dir/
    for example.
    $ man 1 curl
    for more details.

  • FTP log file generation failed in shell script

    Hi ALL,
    I am doing FTP file transfer in shell script and able to FTP the files in to corresponding directory , But when i am trying to check the FTP status through the log files then its giving problem . please check the below code.
    for file in $FILENAME1
    do
    echo "FTP File......$file"
    echo 'FTP the file to AR1 down stream system'
    ret_val=`ftp -n> $file.log <<E
    #ret_val=`ftp -n << !
    open $ar1_server
    user $ar1_uname $ar1_pwd
    hash
    verbose
    cd /var/tmp
    put $file
    bye
    E`
    if [ -f $DATA_OUT/$file.log ]
    then
    grep -i "Transfer complete." $DATA_OUT/$file.log
    if [ $? -eq 0 ]; then
    #mv ${file.log} ${DATA_OUT}/../archive/$file.log.log_`date +"%m%d%y%H%M%S"`
    echo 'Log file archived to archive directory'
    #mv $file ${DATA_OUT}/../archive/$FILENAME1.log_`date +"%m%d%y%H%M%S"`
    echo 'Data file archived to archived directory'
    else
    echo 'FTP process is not successful'
    fi
    else
    echo 'log file generation failed'
    fi
    its giving syntax error end of file not giving the exact line number , please help me on thsi
    Regards
    Deb

    Thanks for ur reply
    Actually i did a mistake in the code i wrote the following piece of code below
    ret_val=`ftp -n> $file.log <<E
    #ret_val=`ftp -n << !
    so after the tilde symbol it as again taking the '# ' as a special character so it was giving error, so i removed the second line now its working fine.

  • Help needed in shell script for FTPS

    Hi,
    Im trying to build a script to download files from a secure FTP site.
    When I run the command ftps <host_address> in the unix prompt, it asks username and password, and then prompts the following question.
    Do you want to trust this certificate? y(y):
    From the prompt, I am able to type 'y' and then it is connecting to the FTP site without any issue.
    When i run the shell script which contains the same command ftps <host_address>, it prompts the same question. And then it comes out of the program saying 'Connection aborted'.
    Could anyone tell me how to avoid this prompt?
    Thanks,
    Vidhya

    Ya. It worked for me when i typed the command ftps <host_address> in the command prompt.
    When I type this command, it is asking for username,pwd and after that, it is asking 'Do you want to trust this certificate?'. For this i have typed 'y' (Yes) in the command prompt.
    After i entered 'y', the connection got established properly.
    I have included this command in a shell script, and ran this script.
    When i execute the script, i asks 'Do you want to trust this certificate?'.
    Since i will not be able to type 'y'(Yes) connection is getting aborted.
    So, I want to know how to avoid this question ot how to enter 'y' while executing the script.
    Thanks

  • Why does Linux kill my shell script after I do an ftp or lftp?

    Hi,
    I've written a series of shell scripts that will log into a client site using ftp or lftp, get a data file , and then log out using quit and then EOF.
    The script excerpt is as follows.
    echo $PROGRAM_NAME - get
    lftp -u $USER,$PASSWORD $HOST <<EOF
    ls
    cd outbound
    ls
    quit
    EOF
    ### validate FTP                                                             ###
    echo $PROGRAM_NAME - validate
    if [ $? != 0 ];
         then
              echo "FAILURE - $FILE_NAME_DAT has failed FTP get." | mail -s "FAILURE - $PROGRAM_NAME" [email protected]
           exit 1
    fiSo from what I have, the output will show the first echo, the output from the lftp session, and then the scripts abruptly ends.
    It never makes to the second echo or for that matter the rest of the script. It just ends.
    The strange part is that I've compared it to scripts that are identical for what functions are being performed and yet the other scripts will continue on after the lftp.
    I've even brought it into MS Word and TextPad to look for hidden characters and they don't show any difference between script files with the error and script files with out it.
    Does anyone have any ideas?
    Thanks

    OK. This is the copy of the similar script that does work.
    I also added a set -vx to the other script.
    As you can see it's very similar in what it does like the other script, however this script puts the
    + lftp -u datamart,vagmr6o sftp://ftp.lowtruck.com...right after the lftp portion and not at the end of the script like the other script did.
    The script with out put is below.
    ### parameter $1 full PATH of the file to be staged                                                                                                    ###
    echo fhs_ftpget_lpmhmk.sh - parameters - $(date)
    date
    ++ date
    + echo fhs_ftpget_lpmhmk.sh - parameters - Thu Apr 14 15:13:36 CDT 2011
    fhs_ftpget_lpmhmk.sh - parameters - Thu Apr 14 15:13:36 CDT 2011
    PROGRAM_NAME=fhs_ftpget_lpmhmk.sh
    + PROGRAM_NAME=fhs_ftpget_lpmhmk.sh
    PRE_PROCESSING_DIRECTORY=/etl/datafeeds/pre_processing
    + PRE_PROCESSING_DIRECTORY=/etl/datafeeds/pre_processing
    PROCESSING_DIRECTORY=/etl/datafeeds/dev
    + PROCESSING_DIRECTORY=/etl/datafeeds/dev
    POST_PROCESSING_DIRECTORY=/etl/datafeeds/post_processing
    + POST_PROCESSING_DIRECTORY=/etl/datafeeds/post_processing
    POST_SOURCE_DIRECTORY=/etl/datafeeds/post_source
    + POST_SOURCE_DIRECTORY=/etl/datafeeds/post_source
    export HOST='sftp://ftp.lowtruck.net'
    + export HOST=sftp://ftp.lowtruck.net
    + HOST=sftp://ftp.lowtruck.net
    export USER='datamart'
    + export USER=datamart
    + USER=datamart
    export PASSWORD='vagmr6o'
    + export PASSWORD=vagmr6o
    + PASSWORD=vagmr6o
    export TEMP_DIRECTORY=/tmp
    + export TEMP_DIRECTORY=/tmp
    + TEMP_DIRECTORY=/tmp
    #export FILE_NAME_SOURCE=*1074691001.txt.gz
    FILE_NAME_GZ=LPMHMK1.gz
    + FILE_NAME_GZ=LPMHMK1.gz
    FILE_NAME_UNZIP=LPMHMK1
    + FILE_NAME_UNZIP=LPMHMK1
    FILE_NAME_DAT=LPMHMK1.dat
    + FILE_NAME_DAT=LPMHMK1.dat
    PASSPHRASE=focusedhs
    + PASSPHRASE=focusedhs
    ### Get File name                                                            ###
    export FILE_NAME_SOURCE=`/home/fhs_clientdata/ftpget/fhs_ftpget_lpmhmk1_get_latest_file.sh| awk '{IGNORECASE=1}/txt.gz/&&!/test/&&!/err/{print $9}'|tail -1`
    /home/fhs_clientdata/ftpget/fhs_ftpget_lpmhmk1_get_latest_file.sh| awk '{IGNORECASE=1}/txt.gz/&&!/test/&&!/err/{print $9}'|tail -1
    ++ /home/fhs_clientdata/ftpget/fhs_ftpget_lpmhmk1_get_latest_file.sh
    ++ awk '{IGNORECASE=1}/txt.gz/&&!/test/&&!/err/{print $9}'
    ++ tail -1
    + export FILE_NAME_SOURCE=20110413_1074691001.txt.gz
    + FILE_NAME_SOURCE=20110413_1074691001.txt.gz
    ### get FTP                                                                  ###
    echo $PROGRAM_NAME - get
    + echo fhs_ftpget_lpmhmk.sh - get
    fhs_ftpget_lpmhmk.sh - get
    lftp -u $USER,$PASSWORD $HOST <<EOF
    ls
    cd medical
    #get -E $FILE_NAME_SOURCE -o $TEMP_DIRECTORY/$FILE_NAME_GZ
    #rm $FILE_NAME_SOURCE can't be used with lftp. The -E in the get command does the same thing.
    quit
    EOF
    + lftp -u datamart,vagmr6o sftp://ftp.lowtruck.com
    drwxr-sr-x   1 40769    2001         4096 Nov 22 10:09 .
    drwxr-sr-x   1 40769    2001         4096 Nov 22 10:09 ..
    drwxr-s---   1 1999     2001         8192 Apr 12 02:02 medical
    ### validate FTP                                                             ###
    echo $PROGRAM_NAME - validate
    + echo fhs_ftpget_lpmhmk.sh - validate
    fhs_ftpget_lpmhmk.sh - validate
    if [ $? != 0 ];
            then
                    echo "FAILURE - $FILE_NAME_DAT has failed FTP get." | mail -s "FAILURE - $PROGRAM_NAME" [email protected]
            exit 1
    fi
    + '[' 0 '!=' 0 ']'
    ### Unzip                                                                    ###
    echo $PROGRAM_NAME - unzip
    + echo fhs_ftpget_lpmhmk.sh - unzip
    fhs_ftpget_lpmhmk.sh - unzip
    # Preserving unzipped copy because gunzip doesn't leave the original file after the unzip.
    #cp -f $TEMP_DIRECTORY/$FILE_NAME_GZ $POST_SOURCE_DIRECTORY
    #gunzip $TEMP_DIRECTORY/$FILE_NAME_GZ
    #gunzip is incapable of directly renaming files that it unzips,
    #so the rename will happen when the file is moved in the next segment.
    ### move unzipped file from FTP_DIRECTORY to PRE_PROCESSING_DIRECTORY        ###
    echo $PROGRAM_NAME - move
    + echo fhs_ftpget_lpmhmk.sh - move
    fhs_ftpget_lpmhmk.sh - move
    #mv -f $TEMP_DIRECTORY/$FILE_NAME_UNZIP $PRE_PROCESSING_DIRECTORY/$FILE_NAME_DAT
    ### exit                                                                     ###
    echo $PROGRAM_NAME - exit
    + echo fhs_ftpget_lpmhmk.sh - exit
    fhs_ftpget_lpmhmk.sh - exit
    exit 0
    + exit 0So when you compare the two scripts, I honestly can't see what the difference is or what I'd have to do in order to fix this.
    Do you have any ideas?
    Thanks,

  • Shell script to send concurrent program output via FTP and Email

    Hi,
    Does any one have a shell script to send the output generated by a concurrent proram
    1 - Using FTP to an external server
    2 - By email as an attachment.
    Thanks

    There are more specific forums which address this question within the Oracle Technology Network. Please consider posting your question there for better responses. The focus of this forum is limited to HRMS suite of modules:
    http://forums.oracle.com/forums/categoryHome.jspa?categoryID=84
    Regards,
    Greg

  • FTP files from Unix box to Windows ( Shell script )--inplemention in Apps

    Hi,
    I have an requirement like need to send files generated at a particular path in the UNIX sever into Windows machine.
    This should be a scheduler( can we create any shell script
    ) for this...
    Note : files generated at Unix move into Windows box....
    Please check and help on this... and let me know if any clarification required on my requirement.
    Thanks,
    Pavan K

    This is relatively easy to do. You will need to write the shell script code and register it as a concurrent program of type "Host". Pl see the Application Developer Guide (for 11i and R12) at http://www.oracle.com/technology/documentation/applications.html for details on how to register a shell script "Host" custom program.
    ML Docs 266268.1, 147455.1, 1013907.6 and 156636.1 have some more info too.
    HTH
    Srini

  • Process Flow - Executing a shell Script

    I have a simple shell script being called at the start of a process flow, up until a few days ago this worked fine across DEV, TEST and PROD.
    It's now stopped working in PROD.
    It executes through the command line fine as an os user and when you inspect:
    select * from all_rt_audit_executions where execution_name like '%SCRIPT_ONLY%' order by updated_on desc;
    The return_result is OK, but the script has not executed (it creates a simple file and I have added another one at the end of the script 'id >> whoami.txt')
    I've no idea what the sysadmin has been up to so can't comment on configuration changes on the box.
    Any ideas?
    Edited by: RodCouncil on Mar 16, 2009 4:51 PM

    First off, if the admin has upgraded or re-installed the repository, it might have reset back to the default security properties
    The properties file is found in $OWB_HOME/owb/bin/admin/Runtime.properties and change the following parameters to NATIVE_JAVA :
    property.RuntimePlatform.0.NativeExecution.FTP.security_constraint = NATIVE_JAVA
    property.RuntimePlatform.0.NativeExecution.Shell.security_constraint = NATIVE_JAVA
    property.RuntimePlatform.0.NativeExecution.SQLPlus.security_constraint = NATIVE_JAVA
    Make sure that there are no trailing spaces on the line after NATIVE_JAVA.
    Also, if they have upgraded software could they have changed the detault UNIX profie so that you are no longer finding executables? Or changed around the file structure so that your script is in a different absolute location so that OWB doesn't find it anymore? Or changed up directory permissions so that the Oracle user can't see the script anymore?
    Just a few thoughts on things to check for....
    I'd ask your sysadmin to check the OWB security profile, and then to try running the script from the Oracle Unix account and let you know the results (assuming that you do not have access to the Oracle user).
    Edited by: zeppo on Mar 16, 2009 10:40 AM

  • Shell script for DB

    Hi,
    I have written shell script for below scenarios, can you please guide me to write this as correct way, requirment is,
    1. i need to connect the database which is on unix server , but before connecting the DB some of the files needs to be removed from \tmp directory.
    2. once removed the script need to connect the database and call the sql file which is in \tmp directory.
    3. the output files will be stored in \tmp directory start with DB name.
    4. finally csv files needs to be transferred to local windows with help of FTP. please find below the script
    #!/bin/sh
    rm -f /tmp/dbmon/DB1*
    CONNSTRING=username/PASSWORD@service
    sqlplus -s $CONNSTRING @/tmp/STATS.sql << EOF
    EXIT;
    EOF
    HOST='xxxxx'
    USER='xxxxx'
    PASSWD='xxxxxx'
    FILE='E:\STATS\DB1.*'
    cd /tmp/dbmon
    ftp -n -v $HOST << EOT
    user $USER $PASSWD
    prompt
    mput $FILE
    bye
    EOT
    EXIT;
    EOF
    Thanks
    Edited by: ASP on Nov 18, 2011 4:45 PM

    Hi ASP
    It's always a good idea to write entries to timestamped log file without which you will never know where the script went wrong or failed.
    This is not tested but just a small example
    #!/bin/sh
    export LOG_DIR=/tmp/log
    export LOGFILE=$LOG_DIR/`basename $0`_${TIMESTAMP}.log
    if [ ! -d $LOG_DIR ]
    then
         mkdir $LOG_DIR
    fi
    echo "Removing the temporary files from /tmp/dbmon at `date +%Y%m%d_%H:%M:%S`" | tee -a $LOG_FILE
    rm -f /tmp/dbmon/DB1*
    CONNSTRING=username/PASSWORD@service
    echo "Run SQLPlus file" | tee -a $LOG_FILE
    sqlplus -s $CONNSTRING @/tmp/STATS.sql << EOF
    EXIT;
    EOF
    echo "Now FTP the files to windows box " | tee -a $LOG_FILE
    HOST='xxxxx'
    USER='xxxxx'
    PASSWD='xxxxxx'
    cd /tmp/dbmon
    ftp -vn $HOST <<EOF
    quote USER $USER
    quote PASS $PASSWD
    ascii
    cd E:\STATS
    mput DB1.*
    bye
    EOF

  • ABAP program to execute shell script !

    Hi Friends,
    I have created some shell scripts and need to be executed through ABAP prog in order to automate some process. can any one tell me how to execute these scripts through ABAP program? i know that we have to setup those scripts through SM69 but i dont have clear idea about this.can some one tell me step by step how to do this. ur help will be awarded in terms of points.
    Thanks

    Define the scripts as commands in SM69. Test them in SM69/SM49 to see if they work.
    Next, go to SE37, run FM SXPG_COMMAND_EXECUTE, and specify your command there. Does it work?
    If yes, you can just code a 'CALL FUNCTION' to this FM in your ABAP program, and you are ready to invoke your script from your ABAP.
    For  a list of functions that work with commands (defined in SM69), do a drop-down on SXPG_COMMAND* in SE37.
    A sample code may look like this
    concatenate zsys_id z_infile z_extfile into parm
        separated by space.
    *C_FTP_COMMAND is a script defined in SM49
        CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
          EXPORTING
            COMMANDNAME                   = C_FTP_COMMAND
            ADDITIONAL_PARAMETERS         = parm
            OPERATINGSYSTEM               = SY-OPSYS
          TABLES
            EXEC_PROTOCOL                 = PROT
          EXCEPTIONS
            NO_PERMISSION                 = 1
            COMMAND_NOT_FOUND             = 2
            PARAMETERS_TOO_LONG           = 3
            SECURITY_RISK                 = 4
            WRONG_CHECK_CALL_INTERFACE    = 5
            PROGRAM_START_ERROR           = 6
            PROGRAM_TERMINATION_ERROR     = 7
            X_ERROR                       = 8
            PARAMETER_EXPECTED            = 9
            TOO_MANY_PARAMETERS           = 10
            ILLEGAL_COMMAND               = 11
            WRONG_ASYNCHRONOUS_PARAMETERS = 12
            CANT_ENQ_TBTCO_ENTRY          = 13
            JOBCOUNT_GENERATION_ERROR     = 14
            OTHERS                        = 15.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        else.
          write: /, 'FTP Function module executed with no errors.'.
        ENDIF.

  • SAP XI: How To Write Shell Script And use it in File Adapter On XI Server

    Hi,
    I want to split file at sender side in XI using Shell Script and then after i want to do
    Mapping.
    Can anyone tell me what exactly it means "write a script in UNIX shell on XI SERVER"?
    Regards,
    Akshay.

    Hi,
    You can execute a Unix script running in the XI server from the File communication channel. Ie. if you want to do something which was not part of XI adapter configuation , then you can make use of external unix script and you can execute those from the XI.
    For this, write a unix script and place in the XI OS level provided that path is accessible from PI Channel.
    E.g
    So u can use this in either Sender Channel to modify the data before it reaches into the Integration Server or in Receiver channel it is generally used to transfer the files into different location via Secure FTP
    SAP help: http://help.sap.com/saphelp_nw2004s/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    Blog:/people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi
    XI  can be in any OS.
    Hope this helps,
    Rgds,
    Moorthy

Maybe you are looking for

  • 1722 error while installing the WSUS

    Hello guys, I've installed WSUS quite a few times before without any errors, but this time in particular I am getting the following error (shown below in Bold). The case was that I already had WSUS installed on the server and I removed it along with

  • Version Cue CS4 Missing, Fatal Error!!! (Mac OS)

    I bought the PS CS4 for OSX alone, without the suite. Although I figured that this would be great and all and everything would work. Although what I learned is that without buying the suite you dont get a copy of version cue. Okay, Im thinking this i

  • Wrong number of photos

    I have 1700 photos exactly in my iPhoto, but when I sync, it says that it's copying 1765. The Photos app says 1700, but the settings app says 1700. I deleted them all from the phone, and it said 0 photos in all places like normal. But when I synced a

  • Anyone used setJMSReplyTo functionality to get response from MDB?

    Ok, so now that I know how to send a message to a MDB via JMS/AQ, how can I get a reply to that message from the MDB? I understand there is a setJMSReplyTo method that can reply to a "temporary queue" but I haven't seen any reference to this in OC4J.

  • HT1338 problem with Mail app and Gmail

    In various occasions the Mail App freezes and the only way to close it is to go to the activity monitor en force quit the program cause it makes the CPU work at 100% without any results. Aditionally I setup my Gmail account in the Mail program accord