as password while archiving.
The password is case-sensitive. If you omit the password on the
command line, you will be prompted with message "Enter password".
Example:
rar a -pmyhoney secret1 *.txt
add files *.txt and encrypt them with password "myhoney".
-p- Do not query password
-r Recurse subdirectories. May be used with commands:
a, u, f, m, x, e, t, p, v, l, c, cf and s.
When used with the commands 'a', 'u', 'f', 'm' will process
files in all sub-directories as well as the current working
directory.
When used with the commands x, e, t, p, v, l, c, cf or s will
process all archives in sub-directories as well as the current
working directory.
-r0 Similar to -r, but when used with the commands 'a', 'u', 'f',
'm' will recurse subdirectories only for those names, which
include wildcard characters '*' and '?'
-ri
[:]
Set priority and sleep time. Available only in RAR for Windows.
This switch regulates system load by RAR in multitasking
environment. Possible task priority
values are 0 - 15.
If
is 0, RAR uses the default task priority.
equal to 1 sets the lowest possible priority,
15 - the highest possible.
Sleep time is a value from 0 to 1000 (milliseconds).
This is a period of time that RAR gives back to the system
after every read or write operation while compressing
or extracting. Non-zero may be useful if you need to reduce
system load even more than can be achieved with
parameter.
Example:
execute RAR with default priority and 10 ms sleep time:
rar a -ri0:10 backup *.*
-rr[N] Add a data recovery record. This switch is used when creating
or modifying an archive to add a data recovery record to
the archive. See the 'rr[N]' command description for details.
-rv[N] Create recovery volumes. This switch is used when creating
a multivolume archive to generate recovery volumes.
See the 'rv[N]' command description for details.
-s Create solid archive. Solid is a special archive type. Please
refer to the appendix "Glossary" for further information.
Example:
create solid archive sources.rar with 512 KB dictionary,
recursing all directories, starting with the current directory.
Add only .asm files:
rar a -s -md512 sources.rar *.asm -r
-s
Similar to -s, but reset solid statistics after compressing
decreases losses in case of solid archive damages.
-se Create solid groups using extension
Similar to -s, but reset solid statistics if file extension
is changed. Usually decreases compression, but also
decreases losses from solid archive damages.
-sfx[name]
Create SFX archives. If this switch is used when creating a new
archive, a Self-Extracting archive (using a module in file
default.sfx or specified in the switch) would be created.
In the Windows version default.sfx should be placed in the
same directory as the rar.exe, in Unix - in the user's
home directory, in /usr/lib or /usr/local/lib.
Example:
rar a -sfxwincon.sfx myinst
create SelF-eXtracting (SFX) archive using wincon.sfx
SFX-module.
-si[name]
Read data from stdin (standard input), when creating
an archive. Optional 'name' parameter allows to specify
a file name of compressed stdin data in the created
archive. If this parameter is missing, the name will be
set to 'stdin'. This switch cannot be used with -v.
Example:
type Tree.Far | rar a -siTree.Far tree.rar
will compress 'type Tree.Far' output as 'Tree.Far' file.
-sv Create independent solid volumes
By default RAR tries to reset solid statistics as soon
as possible when starting a new volume, but only
if enough data was packed after a previous reset
(at least a few megabytes).
This switch forces RAR to ignore packed data size and attempt
to reset statistics for volumes of any size. It decreases
compression, but increases chances to extract a part of data
if one of several solid volumes in a volume set was lost
or damaged.
Note that sometimes RAR cannot reset statistics even
using this switch. For example, it cannot be done when
compressing one large file split between several volumes.
RAR is able to reset solid statistics only between separate
files, but not inside of single file.
Ignored, if used to create non-volume archive.
-sv- Create dependent solid volumes
Disables to reset solid statistics between volumes.
It slightly increases compression, but significantly reduces
chances to extract a part of data if one of several solid
volumes in a volume set was lost or damaged.
Ignored, if used to create non-volume archive.
-s- Disable solid archiving
-t Test files after archiving. This switch is especially
useful in combination with the move command, so files will be
deleted only if the archive had been successfully tested.
-ta
Process only files modified after the specified date.
Format of the date string is YYYYMMDDHHMMSS.
It is allowed to insert separators like '-' or ':' to
the date string and omit trailing fields. For example,
the following switch is correct: -ta2001-11-20
Internally it will be expanded to -ta20011120000000
and treated as "files modified after 0 hour 0 minutes
0 seconds of 20 November 2001".
-tb
Process only files modified before the specified date.
Format of the switch is the same as -ta
-tk Keep original archive date. Prevents RAR from modifying the
archive date when changing an archive.
-tl Set archive time to newest file. Forces RAR to set the date of a
changed archive to the date of the newest file in the archive.
-tn
Assign work directory as
. This switch may be used to assign
the directory for temporary files.
-x
in the name and file parts of file mask. You may specify
the switch '-x' several times.
If mask contains wildcards, it applies to current directory
and its subdirectories. It is not recursive without wildcards,
so if you wish to exclude some "filename" in all directories,
you need to specify two masks: "filename" for current directory
and "*\filename" for subdirectories. If you know an exact path
to file, you can use "path\filename" syntax to exclude only
this copy of "filename". If you use -xpath\filename syntax
when unpacking an archive, "path" must be a path inside of
archive, not a file path on the disk after unpacking.
Examples:
1) rar a -r -x*.bak -x*.rar rawfiles
*.bak and *.rar files will not be added to rawfiles
2) rar a -r -x*\temp\* savec c:\*
compress all files on the disk c: except those in temp
directories
3) rar x -x*.txt docs
extract all files except *.txt from docs.rar
-x@
Example:
rar a [email protected] arch *.exe
-y Assume Yes on all queries.
-z
Limitations
~~~~~~~~~~~
Pathname is limited to 259 symbols.
Maximum archive comment length is 62000 bytes.
Command limitations:
The commands 'd','u','f','c','cf' will not operate with archive
volumes.
The command 'a' cannot be used to update an archive volume, only to
create one.
Exit values
~~~~~~~~~~~
RAR exits with a zero code (0) in case of successful operation. The exit
code of non-zero means the operation was cancelled due to an error:
255 USER BREAK User stopped the process
9 CREATE ERROR Create file error
8 MEMORY ERROR Not enough memory for operation