Command Variables

Top  Previous  Next

Command variables are variables that can be used with all S3Express commands. Variables are substituted with the real values just before executing a command. Variables must be surrounded by <* and *>.

 
COMMAND VARIABLES (USABLE IN ALL COMMANDS)

Variables

Explanation

<*year*>

Current year

<*month*>

Current month

<*day*>

Current day

<*date*>

Current date, equivalent to <*year*><*month*><*day*>

<*hour*>

Current hour, range 0 through 23

<*minute*>

Current minute, range 0 through 59

<*second*>

Current second, range 0 through 59

<*dayofweek*>

Current day of the week (0 = Sunday, 1 = Monday, etc. to 6 = Saturday)

<*dayofyear*>

Current day of the year, number from 1 to 366

<*weeknumber*>

Current week number (ISO 8601)

<*time*>

Current time, equivalent to <*hour*><*min*><*sec*>

<*computer*>

Name of computer where S3Express is running

<*user*>

Name of user running S3Express

Windows Environment Variables: <*environment_variable*>

Any set Windows Environment Variable can be used as a command variable, but '<*' and '*>' must be used instead of '%'.

For example:

%ALLUSERSPROFILE% becomes <*ALLUSERSPROFILE*>

%COMPUTERNAME% becomes <*COMPUTERNAME*>

%HOMEPATH% becomes <*HOMEPATH*>

%WINDIR% becomes <*WINDIR*>

etc.

Command Variables Examples:
 
Upload files to a different subfolder in bucket 'mybucket' every day of year (rotating):
put c:\folder\ mybucket/<*dayofyear*> -s
<*dayofyear*> is replaced with the current day of the year, number from 1 to 366, depending on when S3Express is running
 
Upload files to a different subfolder in bucket 'mybucket' based on computer name running S3Express:
put c:\folder\ mybucket/<*computer*> -s
<*computer*> is replaced with the name of the computer running S3Express
 
List all files in a S3 bucket lastly modified today:
ls mybucket -s -cond="s3_dayofyear = <*dayofyear*> and s3_year = <*year*>"
See Filter Conditions for detailed explanation of the -cond parameter.
 
Delete all files in a S3 bucket that were lastly modified yesterday:
del mybucket -s -cond="(s3_dayofyear = <*dayofyear*> - 1) and s3_year = <*year*>"
See Filter Conditions for detailed explanation of the -cond parameter.