Help > Azure > blob >
mkfile
PreviousNext

  • Overview
  • Syntax
  • Arguments
  • Notes
  • Examples
  • Overview

    create new storage file

    Download ZappyShell

    Syntax

    mkfile <NEW_FILE_NAME> [<CONTENT>] [--region NAME] [--size SIZE]
               [--type TYPE_NAME] [-r|--recursive] [--encoding ENCODING_TYPE]
               [--fromfile LOCAL_FILE_PATH] [-a|--append] [--struct]
               [--header NAME_VALUE] [--meta KEY_VALUE] [--content-type VALUE]
               [--content-encoding VALUE] [--content-disposition VALUE]
               [--content-type-auto] [--expires VALUE] [--del INPUT] [--mov INPUT]
               [--mov-folder FOLDER_PATH] [--sync] [--setdate] [-y|--overwrite]
               [-s|--skip] [-l|--fail] [-p|--prompt] [--crfol]
               [--exclude-olderthan INPUT] [--exclude-newerthan INPUT]
               [-c|--continue-onerror] [--auth NAME] [--accesskey YOUR_ACCESS_KEY]
               [--secretkey YOUR_SECRET_KEY] [--serviceurl URL] [--threads COUNT]
               [--consoleout FILEPATH] [-v|--verbose] [-w|--wait] [-i|--interactive] 
    
    Alias: mkf
    

    Arguments

    Parameter Description
    <NEW_FILE_NAME>
    New file name
    <CONTENT>
    content of the file
    --region NAME
    Region where requests should be redirected. If you don't specify region then all requests are first directed to US Standard Region (us-east-1) for name resolution. If you want to create new bucket in a specific region or you want to reduce latency in name resolution then specify this parameter.. Possible values are [us-west-1 | us-west-2 | eu-west-1 | eu-central-1 | ap-southeast-1 | ap-southeast-2 | ap-northeast-1 | sa-east-1]
    --size SIZE
    Initial size of file (only applicable if type is set to page)
    --type TYPE_NAME
    File type (page or block)
    -r | --recursive
    Scan recursive
    --encoding ENCODING_TYPE
    File encoding type.. Possible values are [ascii|utf8|unicode|utf32|utf7|bigendian-unicode]
    --fromfile LOCAL_FILE_PATH
    input file path from where data will be read to create new file
    -a | --append
    append content at the end
    --struct
    Transfer files along with folder structure. Automatically create missing folders at target location. When you specify this option no need to specify recursive option because its always recursive scan when --struct option specified.
    --header NAME_VALUE
    Additional http header(s) for target cloud storage file in Key=Value (e.g. Cache-Control:max-age=180;Content-Encoding:gzip)
    --meta
    Custom Metadata value in KEY=VALUE format (e.g. OWNER=bob). If you have multiple key value metadata pairs then use multiple command line switches (e.g. --meta dept=HR --meta owner=bob).
    --content-type VALUE
    User defined content-type you want to set for target file(s) after transfer (e.g. e.g. --content-type text\xml). This option instructs browser and other calling application how to open requested file.
    --content-encoding VALUE
    User defined content-encoding you want to set for target file(s) after transfer (e.g. --content-encoding gzip). Most common use of this option is to specify gzip encoding for compressed content. This is the way to instruct browser and web server that we are dealing with compressed content.
    --content-disposition VALUE
    User defined content-disposition you want to set for target file(s) after transfer (e.g. --content-disposition "attachment;filename=myfile.txt" ). This option controls how browser prompts for download file vs displaying content inline
    --content-type-auto
    Automatically determine best match for content type based on file extension. This option is ignored if you specify --content-type option
    --expires VALUE
    Specifies when content expires (HTTP cache-control header). You may enter days or exact datetime when content expires. Valid format specifiers are s,m,h,d (Examples: --expires 2015-12-31 (exact date), --expires 5d (after 5 days), --expires 24h (after 24 hours), --expires 60s (after 60 seconds), --expires 10m (after 10 minutes))
    --del
    Delete source file(s) after successful transfer
    --mov
    Move source file(s) to archive folder after successful transfer
    --mov-folder FOLDER_PATH
    Folder path where you want to move source file(s) after successful transfer. This option only applicable if you specified --mov option. You can timestmp your archive folder path with predefined placeholders (e.g. --mov-folder c:\archive\Load_{{YYYY}}_{{MM}}_{{DD}}). Valid placeholders are [{{DD}},{{MM}},{{MON}},{{YY}},{{YYYY}},{{HH}},{{HH12}},{{HH24}},{{MI}},{{SS}},{{MS}},{{US}},{{DATAROOT}}]
    --sync
    Synchronize source files with target. Files are compared based on size and LastWriteDateUtc if both attributes same in source and target then file is skipped.
    --setdate
    Sets the target file's last-modified time to be the same as the source file's LastModifiedDate after upload or download. When target file is cloud storage file then this option sets Metadata entry rather than setting actual LastModifiedDate because storage file LastModifiedDate attribute is readonly and cannot be changed.
    -y | --overwrite
    Overwrite target file(s) if exists
    -s | --skip
    Skip file transfer and continue with other files
    -l | --fail
    Throw error if target file exists
    -p | --prompt
    Prompt for action if target file exists
    --crfol
    Automatically create missing target folder
    --exclude-olderthan
    Exclude files if they are older than specified period. You may use format specifier or exact date/datetime. Period format specifiers are d,h,m or s (days, hours, minutes or seconds). Example: 5d = (5 days), 5h=(5 hours), 5m=(5 hours), 5s=5s=(5 second), "2015-12-31 11:59:59"=(exact date+time), "2015-12-31"=(exact date)
    --exclude-newerthan
    Exclude files if they are newer than specified period. You may use format specifier or exact date/datetime. Period format specifiers are d,h,m or s (days, hours, minutes or seconds). Example: 5d = (5 days), 5h=(5 hours), 5m=(5 hours), 5s=5s=(5 second), "2015-12-31 11:59:59"=(exact date+time), "2015-12-31"=(exact date)
    -c | --continue-onerror
    Continue on error such as specified file is missing at source
    --auth NAME
    Credential entry name. This entry name must exist (previously saved using setauth command)
    --accesskey YOUR_ACCESS_KEY
    Cloud account access key
    --secretkey YOUR_SECRET_KEY
    Cloud account secret key
    --serviceurl URL
    Service url for cloud service e.g. --serviceurl https://s3-us-west-2.amazonaws.com
    --threads COUNT
    Number of concurrent operations. If you don't specify then system will use default settings to optimize transfer.
    --consoleout FILEPATH
    Captures console output and saves to file
    -v | --verbose
    Log verbosity level. -v means detailed, If you don't specify this option then minimum logging will be done.
    -w | --wait
    Wait for user input before exit
    -i | --interactive
    Continue in interactive mode after this command is completed. This switch is not applicable if you already in interactive mode

    Notes

    Examples

    Examples
    create new blob with some content

    mkfile mycontainer/newfile.txt --text some@@@data@@@abcd
    Append text to existing blob

    mkfile mycontainer/existingfile.txt --text somemoretext123 --append
    create new page blob with initial size. Size format specifiers are kb, mb, gb. If no specifier specified then size it treated as bytes

    mkfile mycontainer/newfile.txt --fromfile c:\dataile.txt --type page --size 10kb --append


    www.zappysys.com | Products | All copyrights reserved. ZappySys LLC.