Forum Discussion

erictran_173846's avatar
erictran_173846
Icon for Nimbostratus rankNimbostratus
Feb 08, 2015

Import multiples iFiles

Anyone knows if there are ways to import multiple ifiles? There are approx 600 ifiles (mostly are jpg and a few html file) and want to find out what are the options available and thank you in advance.

 

6 Replies

  • Hi erictran,

    before importing files make sure there are no spaces in file names and individual file size does not exeed the maximum size of 4 MByte.

    I´m using the following one-liners to get the files into filestore and declare them as iFiles.

    It will be necessary to upload these files i.e. via SCP into a dedicated directory i.e. /shared/fileimport/.
    for file in `ls`; do ls -l | grep -iv '^total' | echo "tmsh create sys file ifile "$file" source-path file:"`pwd`"/"$file | bash -x; done
    
    for file in `ls`; do ls -l | grep -iv '^total' | echo "tmsh create ltm ifile "$file" file-name "$file | bash -x; done
    

    That´s it. Hopefully it saves you a couple of hours. 🙂

    Thanks, Stephan
  • To refine Stephan's response, try this:

    for file in *; do tmsh -c "create sys file ifile $file source-path file:`readlink -f $file`; create ltm ifile $file file-name $file"; done
    
  • uni's avatar
    uni
    Icon for Altostratus rankAltostratus

    To refine Stephan's response, try this:

    for file in *; do tmsh -c "create sys file ifile $file source-path file:`readlink -f $file`; create ltm ifile $file file-name $file"; done