Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Location
    Ogden Utah
    Posts
    34

    Thumbs up Unanswered: I need your opinion

    I would appreciate your comments on the script below. I have a need to time stamp the files that I am bringing in from another server and maintain the integrity of their unique naming convetion . So, after the ftp session is completed I go to the directory where the files are at and use the for loop and cat command to append a time stamp to all the files within the directory and them remove the original file. Is there a shorter or better way of doing this? I do not want to do it during the ftp session...is this ok or do you guys prefer to do it during the ftp session? It would be great to just be able to append the time stamp without concatenating. Looking forward to your replies.

    *************************************
    easy_cat=/files/in/directory/[A-Z0-9] *
    in = /files/in/directory

    if [ -f $easy_cat ]; then
    cd $in
    for i in $easy_cat
    do
    cat $i > $i.$DTTM
    rm $i
    done

    else

    exit
    f
    mvilla

  2. #2
    Join Date
    Jul 2004
    Posts
    45
    I would suggest, If you're automating FTP process, then you can do it along with that! so that whole process would take place at a stretch! sounds good?

  3. #3
    Join Date
    Dec 2003
    Location
    Ogden Utah
    Posts
    34

    ftp

    any suggestion on how to do it through ftp.
    mvilla

  4. #4
    Join Date
    Jul 2004
    Posts
    45
    read username
    read password
    ftp -n -v myRemoteServer <<END_SCRIPT
    user $username $password
    lcd theLocalHostDirectory
    bin
    prompt
    cd theRemoteDirectory
    mput *
    bye
    END_SCRIPT
    #add ur script after this
    #rename files
    ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •