Difference between revisions of "Shell Commands/MirrorCopy"
From MorphOS Library
| (One intermediate revision by the same user not shown) | |||
| Line 34: | Line 34: | ||
DATE - Creates a date-based sub-directory where files are moved with | DATE - Creates a date-based sub-directory where files are moved with | ||
the DELDIR option | the DELDIR option | ||
| − | DATEFORMAT - | + | DATEFORMAT - Formatting string for the DATE directory, see the Date command for |
| − | CONTINUE - | + | substitution operators, but avoid using anything that produces |
| + | : or / characters | ||
| + | CONTINUE - Do not exit on errors while modifying the destination | ||
| + | directory (doesn't affect to scanning errors) | ||
SKIPROOTDOTFILES - Exclude files and dirs in the root dir that start | SKIPROOTDOTFILES - Exclude files and dirs in the root dir that start | ||
with a dot (.recycled and .trashcan, for example) | with a dot (.recycled and .trashcan, for example) | ||
| − | LOGFILE - | + | LOGFILE - Write or append output to a file |
</nowiki> | </nowiki> | ||
| + | |||
| + | '''Note that with the default options, all files that don't exist in the source directory will be deleted from the destination directory! Be very careful when supplying the destination directory (TO) for the progam!''' | ||
| + | |||
| + | The official documentation can be found from the SYS:MorphOS/Locale/Help/english/MirrorBackup.guide file. | ||
Examples: | Examples: | ||
| − | |||
| − | + | Create an exact mirror of a directory (files that don't exist in the source directory anymore will be deleted from the destination directory too): | |
| + | MirrorCopy FROM System: TO Backup:System/ ALL | ||
| + | |||
| + | Copy changed and new files, but don't purge deleted files from the destination: | ||
| + | MirrorCopy FROM Work:Stuff/ TO Backup:Stuff/ ALL NODEL | ||
| + | |||
| + | Move deleted files to another directory instead of deleting them completely: | ||
| + | MirrorCopy FROM System: TO Backup:System/ ALL DELDIR Backup:SystemDeleted | ||
Latest revision as of 12:38, 25 June 2026
MirrorCopy - Mirrors directory trees
F=FROM/A,T=TO/A,V=VERBOSE/S,Q=QUIET/S,ND=NODEL=NODELETE/S,NC=NOCRE=NOCREATION/S, NR=NOREC=NORECREATION/S,NU=NOUPD=NOUPDATE/S,A=ALL/S,NS=NOSOFT/S,NH=NOHARD/S, DD=DELDIR/K,OD=OLDDIR/K,FP=FILEPAT/K,DP=DIRPAT/K,MNDD=MAKENODUMMYDIRS/S,S=STAT=STATS/S, B=BUF=FILEBUFFERSIZE/N,DOSBUFFERS/K/N,D=DATE/S,DATEFORMAT=DATEFMT/K,CNT=CONTINUE/S, SRD=SKIPROOTDOTFILES/S,LOG=LOGFILE/K
FROM - Source directory
TO - Destination directory
VERBOSE - Displays additional information
QUIET - Suppresses all output but errors
NODELETE - Do not delete any entries from the destination
NOCREATION - Not implemented currently
NORECREATION - Do not recreate any entries in the destination, like replacing
a file with a directory
NOUPDATE - Do not update any entries in the destination, but entries may
still be created and deleted
ALL - Includes sub-directories in the operation
NOSOFT - Do not copy soft links, but they still may be removed from
the destination
NOHARD - Do not copy or delete hard links, but they still can get
overwritten by different types of entries
DELDIR - Move files into a specified directory instead of deleting them
(DELDIR must reside on the same volume as TO)
OLDDIR - Not implemented currently
FILEPAT - Not implemented currently
DIRPAT - Not implemented currently
MAKENODUMMYDIRS - Not implemented currently
STATS - Prints statistics of the mirroring operation
FILEBUFFERSIZE - File copy buffer size in kilobytes (default 1024)
DOSBUFFERS - Changes drive's cache buffers temporarily to this value
DATE - Creates a date-based sub-directory where files are moved with
the DELDIR option
DATEFORMAT - Formatting string for the DATE directory, see the Date command for
substitution operators, but avoid using anything that produces
: or / characters
CONTINUE - Do not exit on errors while modifying the destination
directory (doesn't affect to scanning errors)
SKIPROOTDOTFILES - Exclude files and dirs in the root dir that start
with a dot (.recycled and .trashcan, for example)
LOGFILE - Write or append output to a file
Note that with the default options, all files that don't exist in the source directory will be deleted from the destination directory! Be very careful when supplying the destination directory (TO) for the progam!
The official documentation can be found from the SYS:MorphOS/Locale/Help/english/MirrorBackup.guide file.
Examples:
Create an exact mirror of a directory (files that don't exist in the source directory anymore will be deleted from the destination directory too):
MirrorCopy FROM System: TO Backup:System/ ALL
Copy changed and new files, but don't purge deleted files from the destination:
MirrorCopy FROM Work:Stuff/ TO Backup:Stuff/ ALL NODEL
Move deleted files to another directory instead of deleting them completely:
MirrorCopy FROM System: TO Backup:System/ ALL DELDIR Backup:SystemDeleted