RAR command line

By xngo on February 21, 2019

REM Getting the unique timestamp.
SET Unique=%date%_%time%
SET Unique=%Unique:/=.%
SET Unique=%Unique::=.%
SET Unique=%Unique: =%
SET Unique=%Unique:Mon=%
SET Unique=%Unique:Tue=%
SET Unique=%Unique:Wed=%
SET Unique=%Unique:Thu=%
SET Unique=%Unique:Fri=%
SET Unique=%Unique:Sat=%
SET Unique=%Unique:Sun=%

REM -k: Lock archive. Prevent accidental modification from RAR.
REM -rr10: Add 10% recovery records.
REM -m5: Max compression
rar a -k -m5 -rr10 -hpYOUR_PASSWORD tax_%Unique%.rar tax
 
rar a -k -m5 -rr10 lease_%Unique%.rar Lease

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.