Ceci est une ancienne révision du document !
Table des matières
Version : 2024.01
Last update : 2024/11/11 15:48
RH12409 - Archiving and Compression
Contents
- RH12409 - Archiving and Compression
- Contents
- Types of Backup
- Full Backup
- Differential Backup
- Incremental Backup
- Decremental Backup
- Classic Backup Tools
- Preparation
- The Tar Command
- Overview
- LAB #1 - Working with the tar command
- The GPL tar command and compression
- The cpio command
- Overview
- LAB #2 - Working with the cpio command
- The dd command
- Overview
- LAB #3 - Working with the dd command
- The dump and restore commands
- Overview
- Advanced Backup Tools
- Unidirectional Backup Tools
- Multidirectional Backup Tools
- Partition Backup Tools
- LAB #4 - What to Backup First
- Packet List Backup
- Backing up the System Hard Disk Structure
- Backing up the System Hard Disk Mounting Points
- Boot Loader Backup
- GRUB Legacy
- GRUB 2 with BIOS
- GRUB 2 with EFI
- User Directories Backups
- The Rsync Command
- Overview
- LAB #5 - Working with the rsync command
- Compression
- The gzip command
- Overview
- LAB #6 - Working with the gzip command
- The bzip2 command
- Overview
- LAB #7 - Working with the bzip2 command
- The xz command
command * Overview
- LAB #8 - Working with the xz command
- Other utilities
Backup types
Full backup
In this case, all files and folders, the entire partition or the entire disk are backed up:
Restoring requires :
- The last full backup.
Advantage:
- Faster and simpler restoration than restoring from differential and incremental backups.
Disadvantage:
- Requires more storage space than differential and incremental backups.
Differential backup
In this case, modified or newly added data is backed up on the basis of the last full backup:
Restoration requires:
- The last full backup,
- The last differential backup.
Advantage :
- Faster restoration than restoring from an incremental backup.
Disadvantage:
- Requires more storage space than an incremental backup.
Incremental backup
In this case, only what has changed since the last backup (full, differential or incremental) is backed up:
Restoration requires:
- The last full backup,
- All incremental backups made since, and in order.
Advantage:
- Faster backup than full or differential backup,
- Requires less storage space than differential backup.
Disadvantage:
- Takes longer to restore.
Decremental backup
In this case, all the files are backed up and then a backup is produced of what has changed since the last full backup. This backup is called a decremental backup:
Restoration requires:
- The last full backup.
Restoring D-1 requires:
- The last full backup,
- The decremental D backup.
For example, to obtain a system status of D1 when you are at D2, you need to restore the full backup of D2, which is actually D2+D1, and then the decremental backup -D2. In this way, and mathematically, we obtain : D2 + D1 -D2 = D1.
Advantages :
- Faster and simpler restoration than restoring from differential and incremental backups.
Disadvantage:
- Requires more data manipulation for each backup.
Classic backup tools
Preparation
To continue, we need to create a tree structure to be backed up:
[root@redhat9 ~]# mkdir -p /test/dirY; mkdir /test/dirZ [root@redhat9 ~]# cd /test/dirY; touch Y1 Y2 Y3 [root@redhat9 dirY]# cd /test/dirZ; touch Z1 Z2 [root@redhat9 dirZ]# ls -lR /test /test: total 0 drwxr-xr-x. 2 root root 36 Sep 27 07:51 dirY drwxr-xr-x. 2 root root 26 Sep 27 07:51 dirZ /test/dirY: total 0 -rw-r--r--. 1 root root 0 Sep 27 07:51 Y1 -rw-r--r--. 1 root root 0 Sep 27 07:51 Y2 -rw-r--r--. 1 root root 0 Sep 27 07:51 Y3 /test/dirZ: total 0 -rw-r--r--. 1 root root 0 Sep 27 07:51 Z1 -rw-r--r--. 1 root root 0 Sep 27 07:51 Z2
The tar command
Overview
The tar program was originally intended for backing up to magnetic tape, hence its name from tape archiver.
The tar command can save to :
- a special file, for example the name of a tape drive,
- an ordinary file on disk,
- standard output for use in a pipe.
Command Line Switches
The options for the tar command are:
[root@redhat9 dirZ]# tar --help Usage: tar [OPTION...] [FILE]... GNU ‘tar’ saves many files together into a single tape or disk archive, and can restore individual files from the archive. Examples: tar -cf archive.tar foo bar # Create archive.tar from files foo and bar. tar -tvf archive.tar # List all files in archive.tar verbosely. tar -xf archive.tar # Extract all files from archive.tar. Main operation mode: -A, --catenate, --concatenate append tar files to an archive -c, --create create a new archive --delete delete from the archive (not on mag tapes!) -d, --diff, --compare find differences between archive and file system -r, --append append files to the end of an archive --test-label test the archive volume label and exit -t, --list list the contents of an archive -u, --update only append files newer than copy in archive -x, --extract, --get extract files from an archive Operation modifiers: --check-device check device numbers when creating incremental archives (default) -g, --listed-incremental=FILE handle new GNU-format incremental backup -G, --incremental handle old GNU-format incremental backup --hole-detection=TYPE technique to detect holes --ignore-failed-read do not exit with nonzero on unreadable files --level=NUMBER dump level for created listed-incremental archive --no-check-device do not check device numbers when creating incremental archives --no-seek archive is not seekable -n, --seek archive is seekable --occurrence[=NUMBER] process only the NUMBERth occurrence of each file in the archive; this option is valid only in conjunction with one of the subcommands --delete, --diff, --extract or --list and when a list of files is given either on the command line or via the -T option; NUMBER defaults to 1 --sparse-version=MAJOR[.MINOR] set version of the sparse format to use (implies --sparse) -S, --sparse handle sparse files efficiently Local file name selection: --add-file=FILE add given FILE to the archive (useful if its name starts with a dash) -C, --directory=DIR change to directory DIR --exclude=PATTERN exclude files, given as a PATTERN --exclude-backups exclude backup and lock files --exclude-caches exclude contents of directories containing CACHEDIR.TAG, except for the tag file itself --exclude-caches-all exclude directories containing CACHEDIR.TAG --exclude-caches-under exclude everything under directories containing CACHEDIR.TAG --exclude-ignore=FILE read exclude patterns for each directory from FILE, if it exists --exclude-ignore-recursive=FILE read exclude patterns for each directory and its subdirectories from FILE, if it exists --exclude-tag=FILE exclude contents of directories containing FILE, except for FILE itself --exclude-tag-all=FILE exclude directories containing FILE --exclude-tag-under=FILE exclude everything under directories containing FILE --exclude-vcs exclude version control system directories --exclude-vcs-ignores read exclude patterns from the VCS ignore files --no-null disable the effect of the previous --null option --no-recursion avoid descending automatically in directories --no-unquote do not unquote input file or member names --no-verbatim-files-from -T treats file names starting with dash as options (default) --null -T reads null-terminated names; implies --verbatim-files-from --recursion recurse into directories (default) -T, --files-from=FILE get names to extract or create from FILE --unquote unquote input file or member names (default) --verbatim-files-from -T reads file names verbatim (no escape or option handling) -X, --exclude-from=FILE exclude patterns listed in FILE File name matching options (affect both exclude and include patterns): --anchored patterns match file name start --ignore-case ignore case --no-anchored patterns match after any ‘/’ (default for exclusion) --no-ignore-case case sensitive matching (default) --no-wildcards verbatim string matching --no-wildcards-match-slash wildcards do not match ‘/’ (default for exclusion) --wildcards use wildcards (default for exclusion) --wildcards-match-slash wildcards match ‘/’ (default) Overwrite control: --keep-directory-symlink preserve existing symlinks to directories when extracting --keep-newer-files don't replace existing files that are newer than their archive copies -k, --keep-old-files don't replace existing files when extracting, treat them as errors --no-overwrite-dir preserve metadata of existing directories --one-top-level[=DIR] create a subdirectory to avoid having loose files extracted --overwrite overwrite existing files when extracting --overwrite-dir overwrite metadata of existing directories when extracting (default) --recursive-unlink empty hierarchies prior to extracting directory --remove-files remove files after adding them to the archive --skip-old-files don't replace existing files when extracting, silently skip over them -U, --unlink-first remove each file prior to extracting over it -W, --verify attempt to verify the archive after writing it Select output stream: --ignore-command-error ignore exit codes of children --no-ignore-command-error treat non-zero exit codes of children as error -O, --to-stdout extract files to standard output --to-command=COMMAND pipe extracted files to another program Handling of file attributes: --atime-preserve[=METHOD] preserve access times on dumped files, either by restoring the times after reading (METHOD=‘replace’; default) or by not setting the times in the first place (METHOD=‘system’) --clamp-mtime only set time when the file is more recent than what was given with --mtime --delay-directory-restore delay setting modification times and permissions of extracted directories until the end of extraction --group=NAME force NAME as group for added files --group-map=FILE use FILE to map file owner GIDs and names --mode=CHANGES force (symbolic) mode CHANGES for added files --mtime=DATE-OR-FILE set mtime for added files from DATE-OR-FILE -m, --touch don't extract file modified time --no-delay-directory-restore cancel the effect of --delay-directory-restore option --no-same-owner extract files as yourself (default for ordinary users) --no-same-permissions apply the user's umask when extracting permissions from the archive (default for ordinary users) --numeric-owner always use numbers for user/group names --owner=NAME force NAME as owner for added files --owner-map=FILE use FILE to map file owner UIDs and names -p, --preserve-permissions, --same-permissions extract information about file permissions (default for superuser) --same-owner try extracting files with the same ownership as exists in the archive (default for superuser) --sort=ORDER directory sorting order: none (default), name or inode -s, --preserve-order, --same-order member arguments are listed in the same order as the files in the archive Handling of extended file attributes: --acls Enable the POSIX ACLs support --no-acls Disable the POSIX ACLs support --no-selinux Disable the SELinux context support --no-xattrs Disable extended attributes support --selinux Enable the SELinux context support --xattrs Enable extended attributes support --xattrs-exclude=MASK specify the exclude pattern for xattr keys --xattrs-include=MASK specify the include pattern for xattr keys Device selection and switching: --force-local archive file is local even if it has a colon -f, --file=ARCHIVE use archive file or device ARCHIVE -F, --info-script=NAME, --new-volume-script=NAME run script at end of each tape (implies -M) -L, --tape-length=NUMBER change tape after writing NUMBER x 1024 bytes -M, --multi-volume create/list/extract multi-volume archive --rmt-command=COMMAND use given rmt COMMAND instead of rmt --rsh-command=COMMAND use remote COMMAND instead of rsh --volno-file=FILE use/update the volume number in FILE Device blocking: -b, --blocking-factor=BLOCKS BLOCKS x 512 bytes per record -B, --read-full-records reblock as we read (for 4.2BSD pipes) -i, --ignore-zeros ignore zeroed blocks in archive (means EOF) --record-size=NUMBER NUMBER of bytes per record, multiple of 512 Archive format selection: -H, --format=FORMAT create archive of the given format FORMAT is one of the following: gnu GNU tar 1.13.x format oldgnu GNU format as per tar <= 1.12 pax POSIX 1003.1-2001 (pax) format posix same as pax ustar POSIX 1003.1-1988 (ustar) format v7 old V7 tar format --old-archive, --portability same as --format=v7 --pax-option=keyword[[:]=value][,keyword[[:]=value]]... control pax keywords --posix same as --format=posix -V, --label=TEXT create archive with volume name TEXT; at list/extract time, use TEXT as a globbing pattern for volume name Compression options: -a, --auto-compress use archive suffix to determine the compression program -I, --use-compress-program=PROG filter through PROG (must accept -d) -j, --bzip2 filter the archive through bzip2 -J, --xz filter the archive through xz --lzip filter the archive through lzip --lzma filter the archive through xz --format=lzma --lzop filter the archive through lzop --no-auto-compress do not use archive suffix to determine the compression program --zstd filter the archive through zstd -z, --gzip, --gunzip, --ungzip filter the archive through gzip -Z, --compress, --uncompress filter the archive through compress Local file selection: --backup[=CONTROL] backup before removal, choose version CONTROL --hard-dereference follow hard links; archive and dump the files they refer to -h, --dereference follow symlinks; archive and dump the files they point to -K, --starting-file=MEMBER-NAME begin at member MEMBER-NAME when reading the archive --newer-mtime=DATE compare date and time when data changed only -N, --newer=DATE-OR-FILE, --after-date=DATE-OR-FILE only store files newer than DATE-OR-FILE --one-file-system stay in local file system when creating archive -P, --absolute-names don't strip leading ‘/’s from file names --suffix=STRING backup before removal, override usual suffix (‘~’ unless overridden by environment variable SIMPLE_BACKUP_SUFFIX) File name transformations: --strip-components=NUMBER strip NUMBER leading components from file names on extraction --transform=EXPRESSION, --xform=EXPRESSION use sed replace EXPRESSION to transform file names Informative output: --checkpoint[=NUMBER] display progress messages every NUMBERth record (default 10) --checkpoint-action=ACTION execute ACTION on each checkpoint --full-time print file time to its full resolution --index-file=FILE send verbose output to FILE -l, --check-links print a message if not all links are dumped --no-quote-chars=STRING disable quoting for characters from STRING --quote-chars=STRING additionally quote characters from STRING --quoting-style=STYLE set name quoting style; see below for valid STYLE values -R, --block-number show block number within archive with each message --show-defaults show tar defaults --show-omitted-dirs when listing or extracting, list each directory that does not match search criteria --show-snapshot-field-ranges show valid ranges for snapshot-file fields --show-transformed-names, --show-stored-names show file or archive names after transformation --totals[=SIGNAL] print total bytes after processing the archive; with an argument - print total bytes when this SIGNAL is delivered; Allowed signals are: SIGHUP, SIGQUIT, SIGINT, SIGUSR1 and SIGUSR2; the names without SIG prefix are also accepted --utc print file modification times in UTC -v, --verbose verbosely list files processed --warning=KEYWORD warning control -w, --interactive, --confirmation ask for confirmation for every action Compatibility options: -o when creating, same as --old-archive; when extracting, same as --no-same-owner Other options: -?, --help give this help list --restrict disable use of some potentially harmful options --usage give a short usage message --version print program version Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options. The backup suffix is ‘~’, unless set with --suffix or SIMPLE_BACKUP_SUFFIX. The version control may be set with --backup or VERSION_CONTROL, values are: none, off never make backups t, numbered make numbered backups nil, existing numbered if numbered backups exist, simple otherwise never, simple always make simple backups Valid arguments for the --quoting-style option are: literal shell shell-always shell-escape shell-escape-always c c-maybe escape local clocale *This* tar defaults to: --format=gnu -f- -b20 --quoting-style=escape --rmt-command=/etc/rmt --rsh-command=/usr/bin/ssh
LAB #1 - Working with the tar command
You will now save your test folder and its contents to a file:
[root@redhat9 dirZ]# tar cvf /tmp/test.tar /test tar: Removing leading `/' from member names /test/ /test/dirY/ /test/dirY/Y1 /test/dirY/Y2 /test/dirY/Y3 /test/dirZ/ /test/dirZ/Z1 /test/dirZ/Z2
To view the table of contents of your backup, use the following command:
[root@redhat9 dirZ]# tar tvf /tmp/test.tar drwxr-xr-x root/root 0 2024-09-27 07:51 test/ drwxr-xr-x root/root 0 2024-09-27 07:51 test/dirY/ -rw-r--r-- root/root 0 2024-09-27 07:51 test/dirY/Y1 -rw-r--r-- root/root 0 2024-09-27 07:51 test/dirY/Y2 -rw-r--r-- root/root 0 2024-09-27 07:51 test/dirY/Y3 drwxr-xr-x root/root 0 2024-09-27 07:51 test/dirZ/ -rw-r--r-- root/root 0 2024-09-27 07:51 test/dirZ/Z1 -rw-r--r-- root/root 0 2024-09-27 07:51 test/dirZ/Z2
In order to create an incremental backup, you need to create a file that will serve as a time reference:
[root@redhat9 dirZ]# touch /tmp/dateref
Now modify two of the files in your test tree:
[root@redhat9 dirZ]# echo ‘CentOS is great!’ > /test/dirY/Y1 [root@redhat9 dirZ]# echo ‘RHEL is wonderful!’ > /test/dirZ/Z1
To perform your incremental backup, you need to back up only the files modified or created since the creation of your /tmp/dateref file.
So enter the following command:
[root@redhat9 dirZ]# tar -cvf /tmp/incremental.tar -N /tmp/dateref /test tar: Removing leading `/' from member names /test/ /test/dirY/ /test/dirY/Y1 tar: /test/dirY/Y2: file is unchanged; not dumped tar: /test/dirY/Y3: file is unchanged; not dumped /test/dirZ/ /test/dirZ/Z1 tar: /test/dirZ/Z2: file is unchanged; not dumped
Important - Note the use of the -N option with the /tmp/dateref argument, which identifies files modified or created since /tmp/dateref was created.
Now check the contents of the /tmp/incremental.tar archive:
[root@redhat9 dirZ]# tar tvf /tmp/incremental.tar drwxr-xr-x root/root 0 2024-09-27 07:51 test/ drwxr-xr-x root/root 0 2024-09-27 07:51 test/dirY/ -rw-r--r-- root/root 20 2024-09-27 07:58 test/dirY/Y1 drwxr-xr-x root/root 0 2024-09-27 07:51 test/dirZ/ -rw-r--r-- root/root 21 2024-09-27 07:58 test/dirZ/Z1
Now delete the contents of the test directory:
[root@redhat9 ~]# rm -rf /test/*
Important - Note that the system allows you to delete the /test/dirZ directory, yet you are located in this very directory!
In order to restore the files from your first backup, go to the root of your system and restore the contents of your test directory by entering the following tar command:
[root@redhat9 ~]# cd / [root@redhat9 /]# tar xvf /tmp/test.tar test/ test/dirY/ test/dirY/Y1 test/dirY/Y2 test/dirY/Y3 test/dirZ/ test/dirZ/Z1 test/dirZ/Z2
Now note that the operation went well:
root@redhat9 /]# ls -lR /test /test: total 0 drwxr-xr-x. 2 root root 36 Sep 27 07:51 dirY drwxr-xr-x. 2 root root 26 Sep 27 07:51 dirZ /test/dirY: total 0 -rw-r--r--. 1 root root 0 Sep 27 07:51 Y1 -rw-r--r--. 1 root root 0 Sep 27 07:51 Y2 -rw-r--r--. 1 root root 0 Sep 27 07:51 Y3 /test/dirZ: total 0 -rw-r--r--. 1 root root 0 Sep 27 07:51 Z1 -rw-r--r--. 1 root root 0 Sep 27 07:51 Z2
Important - Note that at this point the /test/dirY/Y1 and /test/dirZ/Z1 files are empty.
Now restore your incremental archive:
[root@redhat9 /]# tar xvf /tmp/incremental.tar test/ test/dirY/ test/dirY/Y1 test/dirZ/ test/dirZ/Z1
Now note that the operation has gone well:
[root@redhat9 /]# ls -lR /test /test: total 0 drwxr-xr-x. 2 root root 36 Sep 27 07:51 dirY drwxr-xr-x. 2 root root 26 Sep 27 07:51 dirZ /test/dirY: total 4 -rw-r--r--. 1 root root 20 Sep 27 07:58 Y1 -rw-r--r--. 1 root root 0 Sep 27 07:51 Y2 -rw-r--r--. 1 root root 0 Sep 27 07:51 Y3 /test/dirZ: total 4 -rw-r--r--. 1 root root 21 Sep 27 07:58 Z1 -rw-r--r--. 1 root root 0 Sep 27 07:51 Z2
Important - Note that the /test/dirY/Y1 and /test/dirZ/Z1 files are now non-empty.
The GPL tar command and compression
Lastly, the tar command can archive using compression algorithms:
Algorithm | tar command option |
---|---|
gzip | z |
bzip2 | j |
lzma | J |
The cpio command
Overview
The cpio (Copy Input To Output) command. cpio can handle archives in tar format. The major difference between tar and cpio is that the latter stores the paths to the saved files at the same time as the files themselves. This means that if the absolute path was specified at the time of backup, it is impossible to restore a file to a location other than its original location.
You will now use the cpio software to perform backups and restores.
Command Line Switches
The options for the cpio command are:
[root@redhat9 /]# cpio --help Usage: cpio [OPTION...] [destination-directory] GNU `cpio' copies files to and from archives Examples: # Copy files named in name-list to the archive cpio -o < name-list [> archive] # Extract files from the archive cpio -i [< archive] # Copy files named in name-list to destination-directory cpio -p destination-directory < name-list Main operation mode: -i, --extract Extract files from an archive (run in copy-in mode) -o, --create Create the archive (run in copy-out mode) -p, --pass-through Run in copy-pass mode -t, --list Print a table of contents of the input Operation modifiers valid in any mode: --block-size=BLOCK-SIZE Set the I/O block size to BLOCK-SIZE * 512 bytes -B Set the I/O block size to 5120 bytes -c Identical to ‘-H newc’, use the new (SVR4) portable format. If you wish the old portable (ASCII) archive format, use ‘-H odc’ instead. -C, --io-size=NUMBER Set the I/O block size to the given NUMBER of bytes -D, --directory=DIR Change to directory DIR --force-local Archive file is local, even if its name contains colons -H, --format=FORMAT Use given archive FORMAT --quiet Do not print the number of blocks copied -R, --owner=[USER][:.][GROUP] Set the ownership of all files created to the specified USER and/or GROUP -v, --verbose Verbosely list the files processed -V, --dot Print a ‘.’ for each file processed -W, --warning=FLAG Control warning display. Currently FLAG is one of none', “truncate”, “all”. Multiple options accumulate. Operation modifiers valid in copy-in and copy-out modes -F, --file=[[USER@]HOST:]FILE-NAME Use this FILE-NAME instead of standard input or output. Optional USER and HOST specify the user and host names in case of a remote archive -M, --message=STRING Print STRING when the end of a volume of the backup media is reached --rsh-command=COMMAND Use COMMAND instead of rsh Operation modifiers valid only in copy-in mode: -b, --swap Swap both halfwords of words and bytes of halfwords in the data. Equivalent to -sS -f, --nonmatching Only copy files that do not match any of the given patterns -I [[USER@]HOST:]FILE-NAME Archive filename to use instead of standard input. Optional USER and HOST specify the user and host names in case of a remote archive -n, --numeric-uid-gid In the verbose table of contents listing, show numeric UID and GID -r, --rename Interactively rename files -s, --swap-bytes Swap the bytes of each halfword in the files -S, --swap-halfwords Swap the halfwords of each word (4 bytes) in the files --to-stdout Extract files to standard output -E, --pattern-file=FILE Read additional patterns specifying filenames to extract or list from FILE --only-verify-crc When reading a CRC format archive, only verify the checksum of each file in the archive, don't actually extract the files Operation modifiers valid only in copy-out mode: -A, --append Append to an existing archive. --device-independent, --reproducible Create device-independent (reproducible) archives --ignore-devno Don't store device numbers -O [[USER@]HOST:]FILE-NAME Archive filename to use instead of standard output. Optional USER and HOST specify the user and host names in case of a remote archive --renumber-inodes Renumber inodes Operation modifiers valid only in copy-pass mode: -l, --link Link files instead of copying them, when possible Operation modifiers valid in copy-in and copy-out modes: --absolute-filenames Do not strip file system prefix components from the file names --no-absolute-filenames Create all files relative to the current directory Operation modifiers valid in copy-out and copy-pass modes: -0, --null Filenames in the list are delimited by null characters instead of newlines -a, --reset-access-time Reset the access times of files after reading them -L, --dereference Dereference symbolic links (copy the files that they point to instead of copying the links). Operation modifiers valid in copy-in and copy-pass modes: -d, --make-directories Create leading directories where needed -m, --preserve-modification-time Retain previous file modification times when creating files --no-preserve-owner Do not change the ownership of the files --sparse Write files with large blocks of zeros as sparse files -u, --unconditional Replace all files unconditionally -?, --help give this help list --usage give a short usage message --version print program version Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options. Report bugs to <bug-cpio@gnu.org>.
LAB #2 - Working with the cpio command
As a first step, you need to use the find command to build a list of files to back up:
[root@redhat9 /]# find /test > /tmp/cpio.list [root@redhat9 /]# cat /tmp/cpio.list /test /test/dirY /test/dirY/Y2 /test/dirY/Y3 /test/dirY/Y1 /test/dirZ /test/dirZ/Z2 /test/dirZ/Z1
Now back up the files and directories referenced by the /tmp/cpio.list file:
[root@redhat9 /]# cpio -ov < /tmp/cpio.list > /tmp/test.cpio /test /test/dirY /test/dirY/Y2 /test/dirY/Y3 /test/dirY/Y1 /test/dirZ /test/dirZ/Z2 /test/dirZ/Z1 1 block
Now look at the table of contents of your backup:
[root@redhat9 /]# cpio -it < /tmp/test.cpio /test /test/dirY /test/dirY/Y2 /test/dirY/Y3 /test/dirY/Y1 /test/dirZ /test/dirZ/Z2 /test/dirZ/Z1 1 block
Now delete the /test/dirY directory and its contents:
[root@redhat9 /]# rm -rf /test/dirY
Check that the deletion is successful:
[root@redhat9 /]# ls -lR /test /test: total 0 drwxr-xr-x. 2 root root 26 Sep 27 07:51 dirZ /test/dirZ: total 4 -rw-r--r--. 1 root root 21 Sep 27 07:58 Z1 -rw-r--r--. 1 root root 0 Sep 27 07:51 Z2
Restore deleted files:
[root@redhat9 /]# cpio -ivdum ‘/test/dirY/*’ < /tmp/test.cpio /test/dirY/Y2 /test/dirY/Y3 /test/dirY/Y1 1 block
Important - Note the use of the string ‘/test/dirY/*’ which searches only the dirY directory as well as the Y1, Y2 and Y3 files in the test.cpio archive.
Check that the status:
[root@redhat9 /]# ls -lR /test /test: total 0 drwxr-xr-x. 2 root root 36 Sep 27 08:10 dirY drwxr-xr-x. 2 root root 26 Sep 27 07:51 dirZ /test/dirY: total 4 -rw-r--r--. 1 root root 20 Sep 27 07:58 Y1 -rw-r--r--. 1 root root 0 Sep 27 07:51 Y2 -rw-r--r--. 1 root root 0 Sep 27 07:51 Y3 /test/dirZ: total 4 -rw-r--r--. 1 root root 21 Sep 27 07:58 Z1 -rw-r--r--. 1 root root 0 Sep 27 07:51 Z2
The dd command
Overview
The dd command is not actually a backup command.
The dd command copies the file passed as input to the output file, limiting the number of bytes copied by using two options:
- count
- the number
- bs
- the size of the block to be copied
Command Line Switches
The dd Command Line Switches are:
[root@redhat9 /]# dd --help Usage: dd [OPERAND]... or: dd OPTION Copy a file, converting and formatting according to the operands. bs=BYTES read and write up to BYTES bytes at a time (default: 512); overrides ibs and obs cbs=BYTES convert BYTES bytes at a time conv=CONVS convert the file as per the comma separated symbol list count=N copy only N input blocks ibs=BYTES read up to BYTES bytes at a time (default: 512) if=FILE read from FILE instead of stdin iflag=FLAGS read as per the comma separated symbol list obs=BYTES write BYTES bytes at a time (default: 512) of=FILE write to FILE instead of stdout oflag=FLAGS write as per the comma separated symbol list seek=N skip N obs-sized blocks at start of output skip=N skip N ibs-sized blocks at start of input status=LEVEL The LEVEL of information to print to stderr; none' suppresses everything but error messages, noxfer' suppresses the final transfer statistics, progress' shows periodic transfer statistics N and BYTES may be followed by the following multiplicative suffixes: c=1, w=2, b=512, kB=1000, K=1024, MB=1000*1000, M=1024*1024, xM=M, GB=1000*1000*1000, G=1024*1024*1024, and so on for T, P, E, Z, Y. Binary prefixes can be used, too: KiB=K, MiB=M, and so on. Each CONV symbol may be: ascii from EBCDIC to ASCII ebcdic from ASCII to EBCDIC ibm from ASCII to alternate EBCDIC block pad newline-terminated records with spaces to cbs-size unblock replace trailing spaces in cbs-size records with newline lcase change upper case to lower case ucase change lower case to upper case sparse try to seek rather than write all-NUL output blocks swab swap every pair of input bytes sync pad every input block with NULs to ibs-size; when used with block or unblock, pad with spaces rather than NULs excl fail if the output file already exists nocreat do not create the output file notrunc do not truncate the output file noerror continue after read errors fdatasync physically write output file data before finishing fsync likewise, but also write metadata Each FLAG symbol may be: append append mode (makes sense only for output; conv=notrunc suggested) direct use direct I/O for data directory fail unless a directory dsync use synchronized I/O for data sync likewise, but also for metadata fullblock accumulate full blocks of input (iflag only) nonblock use non-blocking I/O noatime do not update access time nocache Request to drop cache. See also oflag=sync noctty do not assign controlling terminal from file nofollow do not follow symlinks count_bytes treat ‘count=N’ as a byte count (iflag only) skip_bytes treat ‘skip=N’ as a byte count (iflag only) seek_bytes treat ‘seek=N’ as a byte count (oflag only) Sending a USR1 signal to a running ‘dd’ process makes it print I/O statistics to standard error and then resume copying. Options are: --help display this help and exit --version output version information and exit GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Full documentation <https://www.gnu.org/software/coreutils/dd> or available locally via: info ‘(coreutils) dd invocation’
LAB #3 - Working with the dd command
You will now use dd to make a backup of your MBR and partition table.
Make a backup of your MBR, which is located in the first 446 bytes of your /dev/sda disk:
[root@redhat9 /]# dd if=/dev/sda of=/tmp/mbr.save bs=1 count=446 446+0 records in 446+0 records out 446 bytes copied, 0.00114645 s, 389 kB/s
Now make a backup of your partition table which is in the 64 bytes after the 446 previously saved:
[root@redhat9 /]# dd if=/dev/sda of=/tmp/tblpart.save bs=1 count=64 skip=446 64+0 records in 64+0 records out 64 bytes copied, 0.000282251 s, 227 kB/s
Important - Note the use of the skip option, which positions the start of the backup at the 447th byte.
Dump and restore commands
Overview
The dump and restore commands are based on the data storage format ( ext3 ). For this reason, it is not possible to backup directories within a file system, only complete file systems.
It is important to note that the file system must not be used during the dump process. For this reason it is normally advisable to unmount the file system.
There are 10 possible dump levels from 0 to 9. When a dump is performed, the level is specified. Each time a dump is performed, this information is saved in the /etc/dumpdates file.
By definition, a level 0 dump is a full backup, while a level 1 dump is an incremental backup.
Note that files are backed up with relative names. This means that you must position yourself in the file system when restoring with the restore command.
Advanced Backup Tools
Unidirectional Backup Tools
These tools back up files to a local or remote directory in one direction only.
This first table compares the tools in terms of the characteristics and capabilities of the backup operations:
Tool | Backend | Differential backup | Incremental backup | Decremental backup | Built-in scheduling | Built-in restore | Encryption | Compression | Site |
---|---|---|---|---|---|---|---|---|---|
AMANDA | tar, gzip | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | AMANDA |
Areca Backup | Aucun | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | Areca Backup |
bacula (Bareos) | MySQL | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | bacula |
BackInTime | rsync, diff, meld | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | BackInTime |
BackupPC | rsync, samba, tar | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | BackupPC |
Dar | Aucun | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | Dar |
Déjà Dup | duplicity | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | Duplicity |
Grsync | rsync | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | Grsync |
luckyBackup | rsync | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | luckyBackup |
SBackup | Aucun | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | SBackup |
To Do - See List of backup software on Wikipedia for more information.
This second table compares tools sorted by date of the last known version:
Tool | Written in | Licence | Last Version | Version Date | Linux | Windows | Mac | Website |
---|---|---|---|---|---|---|---|---|
Dar | C++ | GPL | 2.6.2 | 09/02/2019 | ![]() | ![]() | ![]() | Dar |
Bacula (Bareos) | C, C++ | GNU Affero General Public License v3.0 | 9.4.2 | 04/02/2019 | ![]() | ![]() | ![]() | bacula |
BackupPC | Perl | GPL v3.0 | 4.3.0 | 25/11/2018 | ![]() | ![]() | ![]() | BackupPC |
luckyBackup | C++ | GPL v3.0 | 0.5.0 | 18/11/2018 | ![]() | ![]() | ![]() | luckyBackup |
Déjà Dup (Duplicity) | Python | GPL | 0.7.18.2 | 17/11/2018 | ![]() | ![]() | ![]() | Duplicity |
AMANDA | C, Perl | GPL, LGPL, Apache, Amanda License | 3.5.1 | 01/12/2017 | ![]() | ![]() | ![]() | AMANDA |
BackInTime | Python3 | GPL | 1.1.24 | 07/11/2017 | ![]() | ![]() | ![]() | BackInTime |
Grsync | GTK | GPL | 1.2.6 | 15/03/2016 | ![]() | ![]() | ![]() | Grsync |
Areca Backup | Java | GPLv2 | 7.5 | 26/08/2015 | ![]() | ![]() | ![]() | Areca Backup |
SBackup | GTK | GPLv2 | 0.11.6 | 24/02/2014 | ![]() | ![]() | ![]() | SBackup |
Multidirectional Backup Tools
These tools synchronise files between two servers.
This first table compares the tools in relation to the characteristics and capabilities of the backup operations:
Tool | Backend | Differential backup | Incremental backup | Decremental backup | Built-in scheduling | Built-in restore | Encryption | Compression |
---|---|---|---|---|---|---|---|---|
FullSync | smb, ftp, sftp | ![]() | ![]() | ![]() | ![]() | S/O | ![]() | ![]() |
FreeFileSync | Aucun | ![]() | ![]() | ![]() | ![]() | S/O | ![]() | ![]() |
unison | SSH, RSH | ![]() | ![]() | ![]() | ![]() | S/O | ![]() | ![]() |
Synkron | Aucun | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
To Do - See the Comparison of file synchronization software page on Wikipedia for more information…
This second table compares tools sorted by date of the last known version:
Tool | Written in | License | Last Version | Version Date | Linux | Windows | Mac | Website |
---|---|---|---|---|---|---|---|---|
FreeFileSync | Divers | GPL v3.0 | 10.8 | 05/01/2019 | ![]() | ![]() | ![]() | FreeFileSync |
unison | OCaml | GPL v3.0 | 2.51.2 | 27/01/2018 | ![]() | ![]() | ![]() | unison |
FullSync | Java | GPLv2 | 0.10.4 | 05/04/2016 | ![]() | ![]() | ![]() | FullSync |
Synkron | C++ | GPL v2 | 1.6.2 | 25/01/2011 | ![]() | ![]() | ![]() | Synkron |
Partition Backup Tools
This first table compares the tools in relation to the characteristics and capabilities of the backup operations:
Tool | Backend | Differential backup | Incremental backup | Decremental backup | Built-in scheduling | Built-in restore | Encryption | Compression |
---|---|---|---|---|---|---|---|---|
CloneZilla | SSH, samba, NFS | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
Partclone | Aucun | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
partimage | Aucun | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
To Do - See the Comparison of disk cloning software page on Wikipedia for more information.
This second table compares tools sorted by the date of last known version:
Tool | Written in | Licence | Last Version | Version Date | Linux | Windows | Mac | Website |
---|---|---|---|---|---|---|---|---|
CloneZilla | Perl, Unix shell | GPL | 2.6.0-37 | 10/01/2019 | ![]() | ![]() | ![]() | CloneZilla |
Partclone | C | GPL | 0.2.89 | 05/07/2016 | ![]() | ![]() | ![]() | Partclone |
partimage | C | GPL | 0.6.9 | 25/07/2010 | ![]() | ![]() | ![]() | Partimage |
LAB #4 - What to Backup
Backup the Package List
Remove the lock files from the RPM database:
root@redhat9 /]# rm -f /var/lib/rpm/__db*
Back up the RPM databases:
[root@redhat9 /]# tar czvf $(hostname).rpmdatabase.tar.gz /var/lib/rpm tar: Removing leading `/' from member names /var/lib/rpm/ /var/lib/rpm/rpmdb.sqlite /var/lib/rpm/rpmdb.sqlite-wal /var/lib/rpm/rpmdb.sqlite-shm /var/lib/rpm/.rpm.lock
To save the list of packages identically in terms of version, use the RPM command:
[root@redhat9 /]# rpm -qa > list-of-packages_`hostname`_`date +%Y-%m-%d-%H-%M`
Check out the contents of this file:
[root@redhat9 /]# more list-of-packages_redhat9.ittraining.loc_2024-09-27-08-15 fonts-filesystem-2.0.5-7.el9.1.noarch xkeyboard-config-2.33-2.el9.noarch abattis-cantarell-fonts-0.301-4.el9.noarch yelp-xsl-40.2-1.el9.noarch mozilla-filesystem-1.9-30.el9.x86_64 google-noto-fonts-common-20201206-4.el9.noarch foomatic-db-filesystem-4.0-72.20210209.el9.noarch adobe-mappings-cmap-20171205-12.el9.noarch subscription-manager-rhsm-certificates-20220623-1.el9.noarch libreport-filesystem-2.15.2-6.el9.noarch adobe-mappings-cmap-deprecated-20171205-12.el9.noarch adobe-source-code-pro-fonts-2.030.1.050-12.el9.1.noarch dejavu-without-mono-fonts-2.37-18.el9.noarch dejavu-without-fonts-2.37-18.el9.noarch langpacks-core-font-en-3.0-16.el9.noarch google-droid-sans-fonts-20200215-11.el9.2.noarch thai-scalable-fonts-common-0.7.2-5.el9.noarch redhat-indexhtml-9-4.el9_2.noarch poppler-data-0.4.9-9.el9.noarch mobile-broadband-provider-info-20210805-2.el9.noarch man-pages-overrides-9.0.0.0-1.el9.noarch hunspell-filesystem-1.7.0-11.el9.x86_64 hplip-common-3.21.2-6.el9.x86_64 gawk-all-langpacks-5.1.0-6.el9.x86_64 adwaita-cursor-theme-40.1.1-3.el9.noarch adobe-mappings-pdf-20180407-10.el9.noarch vim-filesystem-8.2.2637-20.el9_1.noarch rhsm-icons-6-1.el9.noarch filesystem-3.16-2.el9.x86_64 urw-base35-fonts-common-20200910-6.el9.noarch basesystem-11-13.el9.noarch quota-nls-4.06-6.el9.noarch publicsuffix-list-dafsa-20210518-3.el9.noarch pkgconf-m4-1.7.3-10.el9.noarch popt-1.18-8.el9.x86_64 xz-libs-5.2.5-8.el9_0.x86_64 libxcrypt-4.4.18-3.el9.x86_64 bzip2-libs-1.0.8-8.el9.x86_64 libzstd-1.5.1-2.el9.x86_64 libpng-1.6.37-12.el9.x86_64 libcap-ng-0.8.2-7.el9.x86_64 libicu-67.1-9.el9.x86_64 libunistring-0.9.10-15.el9.x86_64 libgpg-error-1.42-5.el9.x86_64 libseccomp-2.5.2-2.el9.x86_64 lcms2-2.12-3.el9.x86_64 readline-8.1-4.el9.x86_64 libwayland-client-1.21.0-1.el9.x86_64 libwayland-server-1.21.0-1.el9.x86_64 jansson-2.14-1.el9.x86_64 libxkbcommon-1.0.3-4.el9.x86_64 libwayland-egl-1.21.0-1.el9.x86_64 keyutils-libs-1.6.3-1.el9.x86_64 libdhash-0.5.0-53.el9.x86_64 libXau-1.0.9-8.el9.x86_64 --More--(4%) [q]
Important - Next, the two files list-of-packages_* and $(hostname).rpmdatabase.tar.gz should be backed up on external media.
In order to restore the backups, retrieve the two files package-list_* and $(hostname).rpmdatabase.tar.gz from the external media at the root of the file system:
[root@redhat9 ~]# cp list-of-packages_redhat9.ittraining.loc_2024-09-27-08-15 redhat9.ittraining.loc.rpmdatabase.tar.gz /
Go to the root of the file system and restore the RPM databases:
[root@redhat9 /]# tar xvf redhat9.ittraining.loc.rpmdatabase.tar.gz var/lib/rpm/ var/lib/rpm/rpmdb.sqlite var/lib/rpm/rpmdb.sqlite-wal var/lib/rpm/rpmdb.sqlite-shm var/lib/rpm/.rpm.lock
Use YUM to restore packages:
[root@redhat9 /]# dnf -y install -y $(cat list-of-packages_redhat9.ittraining.loc_2024-09-27-08-15)
Backing up the System Hard Disk Structure
[root@redhat9 /]# cd ~ [root@redhat9 ~]# fdisk -l /dev/sda > structure.list [root@redhat9 ~]# cat structure.list Disk /dev/sda: 50 GiB, 53687091200 bytes, 104857600 sectors Disk model: QEMU HARDDISK Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xd00dfc8a Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 2099199 2097152 1G 83 Linux /dev/sda2 2099200 104857599 102758400 49G 8e Linux LVM
Important - The structure.list file should then be backed up on external media.
Backing up the System Hard Disk Mount Points
Enter the following command:
[root@redhat9 ~]# df -h | grep ‘^/dev/’ > montages.list [root@redhat9 ~]# cat montages.list /dev/mapper/rhel-root 44G 7.8G 37G 18% / /dev/sda1 1014M 398M 617M 40% /boot
Important - The mountings.list file should then be saved on external media.
Bootloader backup
GRUB Legacy
# cp /boot/grub/menu.lst grubmenu.lst
GRUB 2 with BIOS
Enter the following commands:
[root@redhat9 ~]# cp /boot/grub2/grub.cfg grub.cfg [root@redhat9 ~]# cp /boot/grub2/device.map device.map
GRUB 2 with EFI
# cp /boot/efi/EFI/redhat/grub.cfg grub.cfg # cp /boot/grub2/device.map device.map
Important - You should then save the menu.lst or grub.cfg file and the device.map file on external media.
Backing up User Folders
[root@redhat9 ~]# cp -apv /home/ . ‘/home/’ -> ‘./home’ ‘/home/trainee’ -> ‘./home/trainee’ /home/trainee/training' -> ’./home/trainee/training /home/trainee/training/f1' -> ’./home/trainee/training/f1 ‘/home/trainee/training/f2’ -> ‘./home/trainee/training/f2’ ‘/home/trainee/training/f3’ -> ‘./home/trainee/training/f3’ /home/trainee/training/f4' -> ’./home/trainee/training/f4 /home/trainee/training/f5' -> ’./home/trainee/training/f5 /home/trainee/training/f52' -> ’./home/trainee/training/f52 /home/trainee/training/f62' -> ’./home/trainee/training/f62 ‘/home/trainee/training/a100’ -> ‘./home/trainee/training/a100’ ‘/home/trainee/training/f’ -> ‘./home/trainee/training/f’ ‘/home/trainee/training/f.txt’ -> ‘./home/trainee/training/f.txt’ /home/trainee/training/f123.txt' -> ’./home/trainee/training/f123.txt ‘/home/trainee/training/f123123.txt’ -> ‘./home/trainee/training/f123123.txt’ /home/trainee/training/f123123123.txt' -> “./home/trainee/training/f123123123.txt” /home/trainee/training/file' -> ’./home/trainee/training/file /home/trainee/training/user_check' -> ’./home/trainee/training/user_check /home/trainee/bin' -> ’./home/trainee/bin /home/trainee/bin/myscript' -> ’./home/trainee/bin/myscript /home/trainee/Desktop' -> ’./home/trainee/Desktop /home/trainee/Documents' -> ’./home/trainee/Documents /home/trainee/.config' -> ’./home/trainee/.config /home/trainee/.config/ibus' -> ’./home/trainee/.config/ibus /home/trainee/.config/ibus/bus' -> ’./home/trainee/.config/ibus/bus ‘/home/trainee/.config/ibus/bus/5a35a3eb625c45cea1d33535723e791f-unix-wayland-0’ -> ‘./home/trainee/.config/ibus/bus/5a35a3eb625c45cea1d33535723e791f-unix-wayland-0’ ‘/home/trainee/.config/user-dirs.dirs’ -> ‘./home/trainee/.config/user-dirs.dirs’ /home/trainee/.config/user-dirs.locale' -> ’./home/trainee/.config/user-dirs.locale /home/trainee/.config/evolution' -> ’./home/trainee/.config/evolution /home/trainee/.config/evolution/sources' -> ’./home/trainee/.config/evolution/sources /home/trainee/.config/evolution/sources/system-proxy.source' -> ’./home/trainee/.config/evolution/sources/system-proxy.source /home/trainee/.config/gtk-3.0' -> ’./home/trainee/.config/gtk-3.0 ‘/home/trainee/.config/gtk-3.0/bookmarks’ -> ‘./home/trainee/.config/gtk-3.0/bookmarks ‘/home/trainee/.config/.gsd-keyboard.settings-ported’ -> ‘./home/trainee/.config/.gsd-keyboard.settings-ported’ ‘/home/trainee/.config/gnome-initial-setup-done’ -> ‘./home/trainee/.config/gnome-initial-setup-done’ /home/trainee/.config/goa-1.0' -> ’./home/trainee/.config/goa-1.0 /home/trainee/.config/pulse' -> ’./home/trainee/.config/pulse /home/trainee/.config/pulse/cookie' -> ’./home/trainee/.config/pulse/cookie /home/trainee/.config/dconf' -> ’./home/trainee/.config/dconf /home/trainee/.config/dconf/user' -> ’./home/trainee/.config/dconf/user /home/trainee/codes' -> ’./home/trainee/codes /home/trainee/codes/exit.txt' -> ’./home/trainee/codes/exit.txt /home/trainee/.local' -> ’./home/trainee/.local /home/trainee/.local/share' -> ’./home/trainee/.local/share /home/trainee/.local/share/evolution' -> ’./home/trainee/.local/share/evolution ‘/home/trainee/.local/share/evolution/addressbook’ -> ‘./home/trainee/.local/share/evolution/addressbook’ /home/trainee/.local/share/evolution/addressbook/system' -> ’./home/trainee/.local/share/evolution/addressbook/system ‘/home/trainee/.local/share/evolution/addressbook/system/contacts.db’ -> ‘./home/trainee/.local/share/evolution/addressbook/system/contacts.db ‘/home/trainee/.local/share/evolution/addressbook/system/photos’ -> ‘./home/trainee/.local/share/evolution/addressbook/system/photos’ /home/trainee/.local/share/evolution/addressbook/trash' -> ’./home/trainee/.local/share/evolution/addressbook/trash /home/trainee/.local/share/evolution/mail' -> ’./home/trainee/.local/share/evolution/mail /home/trainee/.local/share/evolution/mail/trash' -> ’./home/trainee/.local/share/evolution/mail/trash /home/trainee/.local/share/evolution/tasks' -> ’./home/trainee/.local/share/evolution/tasks ‘/home/trainee/.local/share/evolution/tasks/system’ -> ‘./home/trainee/.local/share/evolution/tasks/system’ /home/trainee/.local/share/evolution/tasks/system/tasks.ics' -> ’./home/trainee/.local/share/evolution/tasks/system/tasks.ics /home/trainee/.local/share/evolution/tasks/trash' -> ’./home/trainee/.local/share/evolution/tasks/trash /home/trainee/.local/share/evolution/calendar' -> ’./home/trainee/.local/share/evolution/calendar /home/trainee/.local/share/evolution/calendar/trash' -> ’./home/trainee/.local/share/evolution/calendar/trash ‘/home/trainee/.local/share/evolution/calendar/system’ -> ‘./home/trainee/.local/share/evolution/calendar/system’ /home/trainee/.local/share/evolution/calendar/system/calendar.ics' -> ’./home/trainee/.local/share/evolution/calendar/system/calendar.ics ‘/home/trainee/.local/share/evolution/memos’ -> ‘./home/trainee/.local/share/evolution/memos’ /home/trainee/.local/share/evolution/memos/trash' -> ’./home/trainee/.local/share/evolution/memos/trash /home/trainee/.local/share/applications' -> ’./home/trainee/.local/share/applications /home/trainee/.local/share/icc' -> ’./home/trainee/.local/share/icc ‘/home/trainee/.local/share/icc/edid-bb6ad72dc802b000932c73ad20996ae5.icc’ -> ‘./home/trainee/.local/share/icc/edid-bb6ad72dc802b000932c73ad20996ae5.icc’ /home/trainee/.local/share/sounds' -> ’./home/trainee/.local/share/sounds /home/trainee/.local/share/flatpak' -> ’./home/trainee/.local/share/flatpak /home/trainee/.local/share/flatpak/repo' -> ’./home/trainee/.local/share/flatpak/repo ‘/home/trainee/.local/share/flatpak/repo/refs’ -> ‘./home/trainee/.local/share/flatpak/repo/refs’ ‘/home/trainee/.local/share/flatpak/repo/refs/heads’ -> ‘./home/trainee/.local/share/flatpak/repo/refs/heads’ /home/trainee/.local/share/flatpak/repo/refs/mirrors' -> ’./home/trainee/.local/share/flatpak/repo/refs/mirrors /home/trainee/.local/share/flatpak/repo/refs/remotes' -> ’./home/trainee/.local/share/flatpak/repo/refs/remotes /home/trainee/.local/share/flatpak/repo/objects' -> ’./home/trainee/.local/share/flatpak/repo/objects ‘/home/trainee/.local/share/flatpak/repo/config’ -> ‘./home/trainee/.local/share/flatpak/repo/config’ /home/trainee/.local/share/flatpak/repo/tmp' -> ’./home/trainee/.local/share/flatpak/repo/tmp /home/trainee/.local/share/flatpak/repo/tmp/cache' -> ’./home/trainee/.local/share/flatpak/repo/tmp/cache /home/trainee/.local/share/flatpak/repo/extensions' -> ’./home/trainee/.local/share/flatpak/repo/extensions /home/trainee/.local/share/flatpak/repo/state' -> ’./home/trainee/.local/share/flatpak/repo/state /home/trainee/.local/share/flatpak/.changed' -> ’./home/trainee/.local/share/flatpak/.changed /home/trainee/.local/share/flatpak/db' -> “./home/trainee/.local/share/flatpak/db” /home/trainee/.local/share/pki' -> ’./home/trainee/.local/share/pki /home/trainee/.local/share/pki/nssdb' -> ’./home/trainee/.local/share/pki/nssdb /home/trainee/.local/share/keyrings' -> ’./home/trainee/.local/share/keyrings /home/trainee/.local/share/keyrings/login.keyring' -> ’./home/trainee/.local/share/keyrings/login.keyring /home/trainee/.local/share/keyrings/user.keystore' -> ’./home/trainee/.local/share/keyrings/user.keystore /home/trainee/.local/share/gnome-shell' -> ’./home/trainee/.local/share/gnome-shell ‘/home/trainee/.local/share/gnome-shell/gnome-overrides-migrated’ -> ‘./home/trainee/.local/share/gnome-shell/gnome-overrides-migrated’ /home/trainee/.local/share/gnome-shell/application_state' -> ’./home/trainee/.local/share/gnome-shell/application_state /home/trainee/.local/share/gvfs-metadata' -> ’./home/trainee/.local/share/gvfs-metadata /home/trainee/.local/share/gvfs-metadata/home' -> ’./home/trainee/.local/share/gvfs-metadata/home /home/trainee/.local/share/gvfs-metadata/root' -> ’./home/trainee/.local/share/gvfs-metadata/root ‘/home/trainee/.local/share/gvfs-metadata/home-6f6e2002.log’ -> ‘./home/trainee/.local/share/gvfs-metadata/home-6f6e2002.log’ ‘/home/trainee/.local/share/gvfs-metadata/root-47507e37.log’ -> ‘./home/trainee/.local/share/gvfs-metadata/root-47507e37.log’ /home/trainee/.local/share/gnome-settings-daemon' -> ’./home/trainee/.local/share/gnome-settings-daemon /home/trainee/.local/share/gnome-settings-daemon/input-sources-converted' -> ’./home/trainee/.local/share/gnome-settings-daemon/input-sources-converted /home/trainee/.local/state' -> ’./home/trainee/.local/state /home/trainee/.local/state/wireplumber' -> ’./home/trainee/.local/state/wireplumber /home/trainee/.local/state/wireplumber/restore-stream' -> ’./home/trainee/.local/state/wireplumber/restore-stream /home/trainee/Downloads' -> ’./home/trainee/Downloads /home/trainee/Music' -> ’./home/trainee/Music /home/trainee/.cache' -> ’./home/trainee/.cache ‘/home/trainee/.cache/event-sound-cache.tdb.5a35a3eb625c45cea1d33535723e791f.x86_64-redhat-linux-gnu’ -> ‘./home/trainee/.cache/event-sound-cache.tdb.5a35a3eb625c45cea1d33535723e791f.x86_64-redhat-linux-gnu’ /home/trainee/.cache/gstreamer-1.0' -> ’./home/trainee/.cache/gstreamer-1.0 /home/trainee/.cache/gstreamer-1.0/registry.x86_64.bin' -> ’./home/trainee/.cache/gstreamer-1.0/registry.x86_64.bin /home/trainee/.cache/appstream' -> ’./home/trainee/.cache/appstream /home/trainee/.cache/mesa_shader_cache' -> ’./home/trainee/.cache/mesa_shader_cache /home/trainee/.cache/mesa_shader_cache/35' -> ’./home/trainee/.cache/mesa_shader_cache/35 ‘/home/trainee/.cache/mesa_shader_cache/35/fdf1af19fe3030e69e8f1eb8e8b27af5336130’ -> ‘./home/trainee/.cache/mesa_shader_cache/35/fdf1af19fe3030e69e8f1eb8e8b27af5336130’ ‘/home/trainee/.cache/mesa_shader_cache/37’ -> ‘./home/trainee/.cache/mesa_shader_cache/37’ ‘/home/trainee/.cache/mesa_shader_cache/37/e5792d1d01536d5334b02004e37fb0e4447734’ -> ‘./home/trainee/.cache/mesa_shader_cache/37/e5792d1d01536d5334b02004e37fb0e4447734’ /home/trainee/.cache/mesa_shader_cache/db' -> “./home/trainee/.cache/mesa_shader_cache/db” ‘/home/trainee/.cache/mesa_shader_cache/db/61eeaba3f7216beef1a6584479498f1a1bcc6e’ -> ‘./home/trainee/.cache/mesa_shader_cache/db/61eeaba3f7216beef1a6584479498f1a1bcc6e’ ‘/home/trainee/.cache/mesa_shader_cache/89’ -> ‘./home/trainee/.cache/mesa_shader_cache/89’ ‘/home/trainee/.cache/mesa_shader_cache/89/e5753098f3e9b475aea4ee27559d24e8a477cd’ -> ‘./home/trainee/.cache/mesa_shader_cache/89/e5753098f3e9b475aea4ee27559d24e8a477cd’ ‘/home/trainee/.cache/mesa_shader_cache/89/f6154a1a3badafdf80810f15b7fcdcf76055f7’ -> ‘./home/trainee/.cache/mesa_shader_cache/89/f6154a1a3badafdf80810f15b7fcdcf76055f7’ /home/trainee/.cache/mesa_shader_cache/29' -> ’./home/trainee/.cache/mesa_shader_cache/29 ‘/home/trainee/.cache/mesa_shader_cache/29/192c9c298ee4c8c9fbf0ec63ef2235bd284281’ -> ‘./home/trainee/.cache/mesa_shader_cache/29/192c9c298ee4c8c9fbf0ec63ef2235bd284281’ ‘/home/trainee/.cache/mesa_shader_cache/ba’ -> ‘./home/trainee/.cache/mesa_shader_cache/ba’ ‘/home/trainee/.cache/mesa_shader_cache/ba/c8c6c30bb2fd3a6ad51b81489fba57176bdb63’ -> ‘./home/trainee/.cache/mesa_shader_cache/ba/c8c6c30bb2fd3a6ad51b81489fba57176bdb63’ ‘/home/trainee/.cache/mesa_shader_cache/80’ -> ‘./home/trainee/.cache/mesa_shader_cache/80’ ‘/home/trainee/.cache/mesa_shader_cache/80/51554895958b09bfcc357550bff8c7c91d3f13’ -> ‘./home/trainee/.cache/mesa_shader_cache/80/51554895958b09bfcc357550bff8c7c91d3f13’ /home/trainee/.cache/mesa_shader_cache/de' -> ’./home/trainee/.cache/mesa_shader_cache/de ‘/home/trainee/.cache/mesa_shader_cache/de/594a26def33b0ccfc9b9af4ee0d1f15e01af73’ -> ‘./home/trainee/.cache/mesa_shader_cache/de/594a26def33b0ccfc9b9af4ee0d1f15e01af73’ ‘/home/trainee/.cache/mesa_shader_cache/2c’ -> ‘./home/trainee/.cache/mesa_shader_cache/2c’ ‘/home/trainee/.cache/mesa_shader_cache/2c/58c677aeedca2646d85af2feeaa58bcaba11cd’ -> ‘./home/trainee/.cache/mesa_shader_cache/2c/58c677aeedca2646d85af2feeaa58bcaba11cd’ ‘/home/trainee/.cache/mesa_shader_cache/66’ -> ‘./home/trainee/.cache/mesa_shader_cache/66’ ‘/home/trainee/.cache/mesa_shader_cache/66/189cc50668aeaf9534cda7798d819feafd56c7’ -> ‘./home/trainee/.cache/mesa_shader_cache/66/189cc50668aeaf9534cda7798d819feafd56c7’ ‘/home/trainee/.cache/mesa_shader_cache/6e’ -> ‘./home/trainee/.cache/mesa_shader_cache/6e’ ‘/home/trainee/.cache/mesa_shader_cache/6e/590e396934a1b10561cef716c8f8e4ab789a36’ -> ‘./home/trainee/.cache/mesa_shader_cache/6e/590e396934a1b10561cef716c8f8e4ab789a36’ ‘/home/trainee/.cache/mesa_shader_cache/ed’ -> ‘./home/trainee/.cache/mesa_shader_cache/ed’ ‘/home/trainee/.cache/mesa_shader_cache/ed/48dbafa506e7835391085c2b2979ffad8a8940’ -> ‘./home/trainee/.cache/mesa_shader_cache/ed/48dbafa506e7835391085c2b2979ffad8a8940’ ‘/home/trainee/.cache/mesa_shader_cache/56’ -> ‘./home/trainee/.cache/mesa_shader_cache/56’ ‘/home/trainee/.cache/mesa_shader_cache/56/520536fab9c4bd7b65662bdcc0099f3d1fd090’ -> ‘./home/trainee/.cache/mesa_shader_cache/56/520536fab9c4bd7b65662bdcc0099f3d1fd090’ ‘/home/trainee/.cache/mesa_shader_cache/7b’ -> ‘./home/trainee/.cache/mesa_shader_cache/7b’ ‘/home/trainee/.cache/mesa_shader_cache/7b/b2b9a86dde20d2ffe0c14d344d36dfae760c54’ -> ‘./home/trainee/.cache/mesa_shader_cache/7b/b2b9a86dde20d2ffe0c14d344d36dfae760c54’ /home/trainee/.cache/mesa_shader_cache/17' -> ’./home/trainee/.cache/mesa_shader_cache/17 ‘/home/trainee/.cache/mesa_shader_cache/17/7d02a06d53b04eae8fb946e8bff91c951d8dc3’ -> ‘./home/trainee/.cache/mesa_shader_cache/17/7d02a06d53b04eae8fb946e8bff91c951d8dc3’ /home/trainee/.cache/mesa_shader_cache/2e' -> “./home/trainee/.cache/mesa_shader_cache/2e” ‘/home/trainee/.cache/mesa_shader_cache/2f/5b6e06b2728ebe3fa7976bcea3474fed301b2b’ -> ‘./home/trainee/.cache/mesa_shader_cache/2f/5b6e06b2728ebe3fa7976bcea3474fed301b2b’ ‘/home/trainee/.cache/mesa_shader_cache/d0’ -> ‘./home/trainee/.cache/mesa_shader_cache/d0’ ‘/home/trainee/.cache/mesa_shader_cache/d0/6fca52ab2f687b8e6f4c135e084e39bcb0c859’ -> ‘./home/trainee/.cache/mesa_shader_cache/d0/6fca52ab2f687b8e6f4c135e084e39bcb0c859’ ‘/home/trainee/.cache/mesa_shader_cache/9e’ -> ‘./home/trainee/.cache/mesa_shader_cache/9e’ ‘/home/trainee/.cache/mesa_shader_cache/9e/d50ad4e45ed562c3e7b4570526c4cc8154f214’ -> ‘./home/trainee/.cache/mesa_shader_cache/9e/d50ad4e45ed562c3e7b4570526c4cc8154f214’ /home/trainee/.cache/mesa_shader_cache/6c' -> ’./home/trainee/.cache/mesa_shader_cache/6c ‘/home/trainee/.cache/mesa_shader_cache/6c/2e2e9047a693755c7cfdc286874dc0e3e30b4e’ -> ‘./home/trainee/.cache/mesa_shader_cache/6c/2e2e9047a693755c7cfdc286874dc0e3e30b4e’ ‘/home/trainee/.cache/mesa_shader_cache/6c/3101d0fdf7a12f96507b4ac96b83de38448541’ -> ‘./home/trainee/.cache/mesa_shader_cache/6c/3101d0fdf7a12f96507b4ac96b83de38448541’ ‘/home/trainee/.cache/mesa_shader_cache/d3’ -> ‘./home/trainee/.cache/mesa_shader_cache/d3’ ‘/home/trainee/.cache/mesa_shader_cache/d3/075b420db4b80da890c1576f69ba7758421738’ -> ‘./home/trainee/.cache/mesa_shader_cache/d3/075b420db4b80da890c1576f69ba7758421738’ ‘/home/trainee/.cache/mesa_shader_cache/e2’ -> ‘./home/trainee/.cache/mesa_shader_cache/e2’ ‘/home/trainee/.cache/mesa_shader_cache/e2/eda2c17a911182ce0675a982c19d7ec332fe48’ -> ‘./home/trainee/.cache/mesa_shader_cache/e2/eda2c17a911182ce0675a982c19d7ec332fe48’ ‘/home/trainee/.cache/mesa_shader_cache/3c’ -> ‘./home/trainee/.cache/mesa_shader_cache/3c’ ‘/home/trainee/.cache/mesa_shader_cache/3c/5cfbfcea5eaa35a106d2bad38d8d89c7da4759’ -> ‘./home/trainee/.cache/mesa_shader_cache/3c/5cfbfcea5eaa35a106d2bad38d8d89c7da4759’ ‘/home/trainee/.cache/mesa_shader_cache/61’ -> ‘./home/trainee/.cache/mesa_shader_cache/61’ ‘/home/trainee/.cache/mesa_shader_cache/61/d347702600b207e1d67f23f11f089553172512’ -> ‘./home/trainee/.cache/mesa_shader_cache/61/d347702600b207e1d67f23f11f089553172512’ ‘/home/trainee/.cache/mesa_shader_cache/03’ -> ‘./home/trainee/.cache/mesa_shader_cache/03’ ‘/home/trainee/.cache/mesa_shader_cache/03/d956db16f83ba111f7e395ca2e6b7b3f83ff46’ -> ‘./home/trainee/.cache/mesa_shader_cache/03/d956db16f83ba111f7e395ca2e6b7b3f83ff46’ ‘/home/trainee/.cache/mesa_shader_cache/a4’ -> ‘./home/trainee/.cache/mesa_shader_cache/a4’ ‘/home/trainee/.cache/mesa_shader_cache/a4/a2550d53877cc1471892b1bec5444abc719ef8’ -> ‘./home/trainee/.cache/mesa_shader_cache/a4/a2550d53877cc1471892b1bec5444abc719ef8’ ‘/home/trainee/.cache/mesa_shader_cache/ab’ -> ‘./home/trainee/.cache/mesa_shader_cache/ab’ ‘/home/trainee/.cache/mesa_shader_cache/ab/d56ebc4a54bcc4e49aa3dde4fddb884ff797c1’ -> ‘./home/trainee/.cache/mesa_shader_cache/ab/d56ebc4a54bcc4e49aa3dde4fddb884ff797c1’ ‘/home/trainee/.cache/mesa_shader_cache/b1’ -> ‘./home/trainee/.cache/mesa_shader_cache/b1’ ‘/home/trainee/.cache/mesa_shader_cache/b1/8414b51e1825350f6af7ba143d082ba6e91338’ -> ‘./home/trainee/.cache/mesa_shader_cache/b1/8414b51e1825350f6af7ba143d082ba6e91338’ ‘/home/trainee/.cache/mesa_shader_cache/c8’ -> ‘./home/trainee/.cache/mesa_shader_cache/c8’ ‘/home/trainee/.cache/mesa_shader_cache/c8/d3f9f8d81fa2bafb1e8e03193e8861047adcde’ -> ‘./home/trainee/.cache/mesa_shader_cache/c8/d3f9f8d81fa2bafb1e8e03193e8861047adcde’ ‘/home/trainee/.cache/mesa_shader_cache/df’ -> ‘./home/trainee/.cache/mesa_shader_cache/df’ ‘/home/trainee/.cache/mesa_shader_cache/df/ad5863cff76ca47fcea0a47b9f8d81bf57c605’ -> ‘./home/trainee/.cache/mesa_shader_cache/df/ad5863cff76ca47fcea0a47b9f8d81bf57c605’ /home/trainee/.cache/mesa_shader_cache/index' -> “./home/trainee/.cache/mesa_shader_cache/index” ‘/home/trainee/.cache/mesa_shader_cache/fc’ -> ‘./home/trainee/.cache/mesa_shader_cache/fc’ ‘/home/trainee/.cache/mesa_shader_cache/fc/0a9b98f3ab91773422fdf596d8b90aa3f0319f’ -> ‘./home/trainee/.cache/mesa_shader_cache/fc/0a9b98f3ab91773422fdf596d8b90aa3f0319f’ /home/trainee/.cache/mesa_shader_cache/0f' -> “./home/trainee/.cache/mesa_shader_cache/0f” ‘/home/trainee/.cache/mesa_shader_cache/0f/30c6ae612cca20f942383cf6c3d207a5fa23cc’ -> ‘./home/trainee/.cache/mesa_shader_cache/0f/30c6ae612cca20f942383cf6c3d207a5fa23cc’ ‘/home/trainee/.cache/mesa_shader_cache/0f/10bb2c604d0ef8a698a506a297cc7a72885e1f’ -> ‘./home/trainee/.cache/mesa_shader_cache/0f/10bb2c604d0ef8a698a506a297cc7a72885e1f’ ‘/home/trainee/.cache/mesa_shader_cache/9a’ -> ‘./home/trainee/.cache/mesa_shader_cache/9a’ ‘/home/trainee/.cache/mesa_shader_cache/9a/32ee45d4531554f10a8184bf639fdf0a072fba’ -> ‘./home/trainee/.cache/mesa_shader_cache/9a/32ee45d4531554f10a8184bf639fdf0a072fba’ ‘/home/trainee/.cache/mesa_shader_cache/9a/3061c95eb9135ea46575ef514f2fae7f4711cc’ -> ‘./home/trainee/.cache/mesa_shader_cache/9a/3061c95eb9135ea46575ef514f2fae7f4711cc’ ‘/home/trainee/.cache/mesa_shader_cache/06’ -> ‘./home/trainee/.cache/mesa_shader_cache/06’ ‘/home/trainee/.cache/mesa_shader_cache/06/3c901c6133c1b0568bb9b8ff1d4a35af6d8df4’ -> ‘./home/trainee/.cache/mesa_shader_cache/06/3c901c6133c1b0568bb9b8ff1d4a35af6d8df4’ ‘/home/trainee/.cache/mesa_shader_cache/7c’ -> ‘./home/trainee/.cache/mesa_shader_cache/7c’ ‘/home/trainee/.cache/mesa_shader_cache/7c/40694e298e691a0e7ac606cb160097a65c5fe9’ -> ‘./home/trainee/.cache/mesa_shader_cache/7c/40694e298e691a0e7ac606cb160097a65c5fe9’ ‘/home/trainee/.cache/mesa_shader_cache/77’ -> ‘./home/trainee/.cache/mesa_shader_cache/77’ ‘/home/trainee/.cache/mesa_shader_cache/77/390cf9430a3344e71ec336b898ff0af5362f27’ -> ‘./home/trainee/.cache/mesa_shader_cache/77/390cf9430a3344e71ec336b898ff0af5362f27’ ‘/home/trainee/.cache/mesa_shader_cache/57’ -> ‘./home/trainee/.cache/mesa_shader_cache/57’ ‘/home/trainee/.cache/mesa_shader_cache/57/b7f8fa574271b61ecbd67cfdbf0fbfa4e7309f’ -> ‘./home/trainee/.cache/mesa_shader_cache/57/b7f8fa574271b61ecbd67cfdbf0fbfa4e7309f’ /home/trainee/.cache/mesa_shader_cache/78' -> ’./home/trainee/.cache/mesa_shader_cache/78 ‘/home/trainee/.cache/mesa_shader_cache/78/37d600b50e8a23efed7bcb298703d700c4bdde’ -> ‘./home/trainee/.cache/mesa_shader_cache/78/37d600b50e8a23efed7bcb298703d700c4bdde’ ‘/home/trainee/.cache/mesa_shader_cache/08’ -> ‘./home/trainee/.cache/mesa_shader_cache/08’ ‘/home/trainee/.cache/mesa_shader_cache/08/c25769e6f0d114ee11363b6a006276457ba0fe’ -> ‘./home/trainee/.cache/mesa_shader_cache/08/c25769e6f0d114ee11363b6a006276457ba0fe’ ‘/home/trainee/.cache/mesa_shader_cache/52’ -> ‘./home/trainee/.cache/mesa_shader_cache/52’ ‘/home/trainee/.cache/mesa_shader_cache/52/675f8b2f5bf87b675ae31f54f2b3c412721c24’ -> ‘./home/trainee/.cache/mesa_shader_cache/52/675f8b2f5bf87b675ae31f54f2b3c412721c24’ /home/trainee/.cache/mesa_shader_cache/72' -> ’./home/trainee/.cache/mesa_shader_cache/72 ‘/home/trainee/.cache/mesa_shader_cache/72/6f5d4d61d416fbce8e03f0ba6f3be83b7617ef’ -> ‘./home/trainee/.cache/mesa_shader_cache/72/6f5d4d61d416fbce8e03f0ba6f3be83b7617ef’ ‘/home/trainee/.cache/mesa_shader_cache/1d’ -> ‘./home/trainee/.cache/mesa_shader_cache/1d’ ‘/home/trainee/.cache/mesa_shader_cache/1d/16707620c6d057cc29f510df219eae84cb9433’ -> ‘./home/trainee/.cache/mesa_shader_cache/1d/16707620c6d057cc29f510df219eae84cb9433’ ‘/home/trainee/.cache/mesa_shader_cache/da’ -> ‘./home/trainee/.cache/mesa_shader_cache/da’ ‘/home/trainee/.cache/mesa_shader_cache/da/35509cf05c257db6419f61347e3abcbfb47931’ -> ‘./home/trainee/.cache/mesa_shader_cache/da/35509cf05c257db6419f61347e3abcbfb47931’ ‘/home/trainee/.cache/mesa_shader_cache/b2’ -> ‘./home/trainee/.cache/mesa_shader_cache/b2’ ‘/home/trainee/.cache/mesa_shader_cache/b2/cfbf371328300a5b5d686da17d3722ea1ea680’ -> ‘./home/trainee/.cache/mesa_shader_cache/b2/cfbf371328300a5b5d686da17d3722ea1ea680’ ‘/home/trainee/.cache/mesa_shader_cache/3d’ -> ‘./home/trainee/.cache/mesa_shader_cache/3d’ ‘/home/trainee/.cache/mesa_shader_cache/3d/e830f90f2d4d3d79bba17a59903ad4aa4736ed’ -> ‘./home/trainee/.cache/mesa_shader_cache/3d/e830f90f2d4d3d79bba17a59903ad4aa4736ed’ ‘/home/trainee/.cache/mesa_shader_cache/53’ -> ‘./home/trainee/.cache/mesa_shader_cache/53’ ‘/home/trainee/.cache/mesa_shader_cache/53/5db4be69e145c6708f2d30c70b5a292464c990’ -> ‘./home/trainee/.cache/mesa_shader_cache/53/5db4be69e145c6708f2d30c70b5a292464c990’ ‘/home/trainee/.cache/mesa_shader_cache/e7’ -> ‘./home/trainee/.cache/mesa_shader_cache/e7’ ‘/home/trainee/.cache/mesa_shader_cache/e7/b2552c608263fa6b536e5aba787ce66bbb222b’ -> ‘./home/trainee/.cache/mesa_shader_cache/e7/b2552c608263fa6b536e5aba787ce66bbb222b’ ‘/home/trainee/.cache/mesa_shader_cache/59’ -> ‘./home/trainee/.cache/mesa_shader_cache/59’ ‘/home/trainee/.cache/mesa_shader_cache/59/87c57c825b5080423c1f92ee06f23998a21164’ -> ‘./home/trainee/.cache/mesa_shader_cache/59/87c57c825b5080423c1f92ee06f23998a21164’ ‘/home/trainee/.cache/mesa_shader_cache/04’ -> ‘./home/trainee/.cache/mesa_shader_cache/04’ ‘/home/trainee/.cache/mesa_shader_cache/04/7e399922091e12b6b1038ffd9d65cb8a8d4e52’ -> ‘./home/trainee/.cache/mesa_shader_cache/04/7e399922091e12b6b1038ffd9d65cb8a8d4e52’ ‘/home/trainee/.cache/mesa_shader_cache/5e’ -> ‘./home/trainee/.cache/mesa_shader_cache/5e’ ‘/home/trainee/.cache/mesa_shader_cache/5e/c3362db3becd652b156ef7cef7b65a14000175’ -> ‘./home/trainee/.cache/mesa_shader_cache/5e/c3362db3becd652b156ef7cef7b65a14000175’ ‘/home/trainee/.cache/mesa_shader_cache/4b’ -> ‘./home/trainee/.cache/mesa_shader_cache/4b’ ‘/home/trainee/.cache/mesa_shader_cache/4b/c7bfac6ba6440df22b676247a760ea33ef00e9’ -> ‘./home/trainee/.cache/mesa_shader_cache/4b/c7bfac6ba6440df22b676247a760ea33ef00e9’ /home/trainee/.cache/mesa_shader_cache/38' -> ’./home/trainee/.cache/mesa_shader_cache/38 ‘/home/trainee/.cache/mesa_shader_cache/38/ab4c0ec5a2678353a62e2adb585cac57621027’ -> ‘./home/trainee/.cache/mesa_shader_cache/38/ab4c0ec5a2678353a62e2adb585cac57621027’ ‘/home/trainee/.cache/mesa_shader_cache/f0’ -> ‘./home/trainee/.cache/mesa_shader_cache/f0’ ‘/home/trainee/.cache/mesa_shader_cache/f0/23c0293a789bd41028bbe52116a8050da78300’ -> ‘./home/trainee/.cache/mesa_shader_cache/f0/23c0293a789bd41028bbe52116a8050da78300’ ‘/home/trainee/.cache/mesa_shader_cache/f0/fe14587cf5f14504a4d663d50b842ab6708459’ -> ‘./home/trainee/.cache/mesa_shader_cache/f0/fe14587cf5f14504a4d663d50b842ab6708459’ /home/trainee/.cache/mesa_shader_cache/0a' -> “./home/trainee/.cache/mesa_shader_cache/0a” ‘/home/trainee/.cache/mesa_shader_cache/0a/2e07fbab5189565440428bc82a0b3716f1c7f9’ -> ‘./home/trainee/.cache/mesa_shader_cache/0a/2e07fbab5189565440428bc82a0b3716f1c7f9’ ‘/home/trainee/.cache/mesa_shader_cache/21’ -> ‘./home/trainee/.cache/mesa_shader_cache/21’ ‘/home/trainee/.cache/mesa_shader_cache/21/f7c9c648eaf6ad5386e464adf635c5fcbda019’ -> ‘./home/trainee/.cache/mesa_shader_cache/21/f7c9c648eaf6ad5386e464adf635c5fcbda019’ ‘/home/trainee/.cache/mesa_shader_cache/41’ -> ‘./home/trainee/.cache/mesa_shader_cache/41’ ‘/home/trainee/.cache/mesa_shader_cache/41/c7d27f4328971dfae62cbeeb047f4051f58de2’ -> ‘./home/trainee/.cache/mesa_shader_cache/41/c7d27f4328971dfae62cbeeb047f4051f58de2’ ‘/home/trainee/.cache/mesa_shader_cache/2b’ -> ‘./home/trainee/.cache/mesa_shader_cache/2b’ ‘/home/trainee/.cache/mesa_shader_cache/2b/a8165b2be71340b0d73b74a10311320d6c8cf2’ -> ‘./home/trainee/.cache/mesa_shader_cache/2b/a8165b2be71340b0d73b74a10311320d6c8cf2’ /home/trainee/.cache/mesa_shader_cache/13' -> ’./home/trainee/.cache/mesa_shader_cache/13 ‘/home/trainee/.cache/mesa_shader_cache/13/b31a6f63cea64dc9bbe84ea28710f135184274’ -> ‘./home/trainee/.cache/mesa_shader_cache/13/b31a6f63cea64dc9bbe84ea28710f135184274’ ‘/home/trainee/.cache/mesa_shader_cache/c4’ -> ‘./home/trainee/.cache/mesa_shader_cache/c4’ ‘/home/trainee/.cache/mesa_shader_cache/c4/9bbd97238c5299a3e74ac9606194a6bbe48334’ -> ‘./home/trainee/.cache/mesa_shader_cache/c4/9bbd97238c5299a3e74ac9606194a6bbe48334’ ‘/home/trainee/.cache/mesa_shader_cache/63’ -> ‘./home/trainee/.cache/mesa_shader_cache/63’ ‘/home/trainee/.cache/mesa_shader_cache/63/9e6e421d46d0b2e7802b4919b10a7c3cfb5a57’ -> ‘./home/trainee/.cache/mesa_shader_cache/63/9e6e421d46d0b2e7802b4919b10a7c3cfb5a57’ /home/trainee/.cache/ibus' -> ’./home/trainee/.cache/ibus /home/trainee/.cache/flatpak' -> ’./home/trainee/.cache/flatpak /home/trainee/.cache/flatpak/system-cache' -> ’./home/trainee/.cache/flatpak/system-cache /home/trainee/.cache/evolution' -> ’./home/trainee/.cache/evolution /home/trainee/.cache/evolution/addressbook' -> ’./home/trainee/.cache/evolution/addressbook /home/trainee/.cache/evolution/addressbook/trash' -> ’./home/trainee/.cache/evolution/addressbook/trash /home/trainee/.cache/evolution/mail' -> ’./home/trainee/.cache/evolution/mail /home/trainee/.cache/evolution/mail/trash' -> ’./home/trainee/.cache/evolution/mail/trash /home/trainee/.cache/evolution/sources' -> ’./home/trainee/.cache/evolution/sources /home/trainee/.cache/evolution/sources/trash' -> ’./home/trainee/.cache/evolution/sources/trash /home/trainee/.cache/evolution/calendar' -> ’./home/trainee/.cache/evolution/calendar /home/trainee/.cache/evolution/calendar/trash' -> ’./home/trainee/.cache/evolution/calendar/trash /home/trainee/.cache/evolution/memos' -> ’./home/trainee/.cache/evolution/memos /home/trainee/.cache/evolution/memos/trash' -> ’./home/trainee/.cache/evolution/memos/trash /home/trainee/.cache/evolution/tasks' -> ’./home/trainee/.cache/evolution/tasks /home/trainee/.cache/evolution/tasks/trash' -> ’./home/trainee/.cache/evolution/tasks/trash /home/trainee/.cache/gnome-software' -> ’./home/trainee/.cache/gnome-software /home/trainee/.cache/gnome-software/appstream' -> ’./home/trainee/.cache/gnome-software/appstream ‘/home/trainee/.cache/gnome-software/appstream/components.xmlb’ -> ‘./home/trainee/.cache/gnome-software/appstream/components.xmlb’ /home/trainee/.cache/gnome-software/flatpak-system-default' -> “./home/trainee/.cache/gnome-software/flatpak-system-default” /home/trainee/.cache/gnome-software/flatpak-system-default/components.xmlb' -> “./home/trainee/.cache/gnome-software/flatpak-system-default/components.xmlb” ‘/home/trainee/.cache/gnome-software/flatpak-user-user’ -> ‘./home/trainee/.cache/gnome-software/flatpak-user-user’ /home/trainee/.cache/gnome-software/flatpak-user-user/components.xmlb' -> “./home/trainee/.cache/gnome-software/flatpak-user-user/components.xmlb” /home/trainee/.cache/gnome-software/odrs' -> ’./home/trainee/.cache/gnome-software/odrs ‘/home/trainee/.cache/gnome-software/odrs/ratings.json’ -> ‘./home/trainee/.cache/gnome-software/odrs/ratings.json’ /home/trainee/.bash_logout' -> ’./home/trainee/.bash_logout /home/trainee/.exrc' -> ’./home/trainee/.exrc /home/trainee/.viminfo' -> ’./home/trainee/.viminfo /home/trainee/vitext' -> ’./home/trainee/vitext /home/trainee/aac' -> ’./home/trainee/aac /home/trainee/abc' -> ’./home/trainee/abc /home/trainee/bca' -> ’./home/trainee/bca ‘/home/trainee/xyz’ -> ‘./home/trainee/xyz /home/trainee/.lesshst' -> ’./home/trainee/.lesshst /home/trainee/errorlog' -> ’./home/trainee/errorlog /home/trainee/file' -> ’./home/trainee/file /home/trainee/file1' -> ’./home/trainee/file1 /home/trainee/file2' -> ’./home/trainee/file2 /home/trainee/list' -> ’./home/trainee/list /home/trainee/typescript' -> ’./home/trainee/typescript /home/trainee/Templates' -> ’./home/trainee/Templates /home/trainee/Pictures' -> ’./home/trainee/Pictures /home/trainee/.bash_profile' -> ’./home/trainee/.bash_profile /home/trainee/.bashrc' -> ’./home/trainee/.bashrc /home/trainee/.bash_history' -> ’./home/trainee/.bash_history /home/trainee/Public' -> ’./home/trainee/Public /home/trainee/Videos' -> ’./home/trainee/Videos /home/trainee/.mozilla' -> ’./home/trainee/.mozilla /home/trainee/.mozilla/extensions' -> ’./home/trainee/.mozilla/extensions ‘/home/trainee/.mozilla/plugins’ -> ‘./home/trainee/.mozilla/plugins’
Important - The /root/home folder should then be backed up on external media.
The Rsync command
Overview
Rsync or Remote Sync is a file synchronisation utility that uses an algorithm that minimises the amount of data copied by only copying the parts of files that have been modified.
LAB #5 - Working with the rsync command
Create the directories /test/dirA and mkdir /test/dirB :
[root@redhat9 ~]# mkdir -p /test/dirA; mkdir /test/dirB
Now create 20 empty files in the /test/dirA directory:
[root@redhat9 ~]# touch /test/dirA/file{1..20} [root@redhat9 ~]# ls -l /test/dirA/ total 0 -rw-r--r--. 1 root root 0 Sep 27 11:43 file1 -rw-r--r--. 1 root root 0 Sep 27 11:43 file10 -rw-r--r--. 1 root root 0 Sep 27 11:43 file11 -rw-r--r--. 1 root root 0 Sep 27 11:43 file12 -rw-r--r--. 1 root root 0 Sep 27 11:43 file13 -rw-r--r--. 1 root root 0 Sep 27 11:43 file14 -rw-r--r--. 1 root root 0 Sep 27 11:43 file15 -rw-r--r--. 1 root root 0 Sep 27 11:43 file16 -rw-r--r--. 1 root root 0 Sep 27 11:43 file17 -rw-r--r--. 1 root root 0 Sep 27 11:43 file18 -rw-r--r--. 1 root root 0 Sep 27 11:43 file19 -rw-r--r--. 1 root root 0 Sep 27 11:43 file2 -rw-r--r--. 1 root root 0 Sep 27 11:43 file20 -rw-r--r--. 1 root root 0 Sep 27 11:43 file3 -rw-r--r--. 1 root root 0 Sep 27 11:43 file4 -rw-r--r--. 1 root root 0 Sep 27 11:43 file5 -rw-r--r--. 1 root root 0 Sep 27 11:43 file6 -rw-r--r--. 1 root root 0 Sep 27 11:43 file7 -rw-r--r--. 1 root root 0 Sep 27 11:43 file8 -rw-r--r--. 1 root root 0 Sep 27 11:43 file9
To synchronise files from /test/dirA to the /test/dirB directory, use the -r option of the rsync command :
[root@redhat9 ~]# rsync -r /test/dirA/ /test/dirB [root@redhat9 ~]# ls -l /test/dirB/ total 0 -rw-r--r--. 1 root root 0 Sep 27 11:45 file1 -rw-r--r--. 1 root root 0 Sep 27 11:45 file10 -rw-r--r--. 1 root root 0 Sep 27 11:45 file11 -rw-r--r--. 1 root root 0 Sep 27 11:45 file12 -rw-r--r--. 1 root root 0 Sep 27 11:45 file13 -rw-r--r--. 1 root root 0 Sep 27 11:45 file14 -rw-r--r--. 1 root root 0 Sep 27 11:45 file15 -rw-r--r--. 1 root root 0 Sep 27 11:45 file16 -rw-r--r--. 1 root root 0 Sep 27 11:45 file17 -rw-r--r--. 1 root root 0 Sep 27 11:45 file18 -rw-r--r--. 1 root root 0 Sep 27 11:45 file19 -rw-r--r--. 1 root root 0 Sep 27 11:45 file2 -rw-r--r--. 1 root root 0 Sep 27 11:45 file20 -rw-r--r--. 1 root root 0 Sep 27 11:45 file3 -rw-r--r--. 1 root root 0 Sep 27 11:45 file4 -rw-r--r--. 1 root root 0 Sep 27 11:45 file5 -rw-r--r--. 1 root root 0 Sep 27 11:45 file6 -rw-r--r--. 1 root root 0 Sep 27 11:45 file7 -rw-r--r--. 1 root root 0 Sep 27 11:45 file8 -rw-r--r--. 1 root root 0 Sep 27 11:45 file9
Important - Note that the timestamp of the synchronized files has not been preserved.
Delete the files in /test/dirB :
[root@redhat9 ~]# rm -rf /test/dirB/* [root@redhat9 ~]# ls -l /test/dirB/ total 0
To synchronize files from /test/dirA to the /test/dirB directory, use the -a option of the rsync command :
[root@redhat9 ~]# rsync -a /test/dirA/ /test/dirB [root@redhat9 ~]# ls -l /test/dirB/ total 0 -rw-r--r--. 1 root root 0 Sep 27 11:43 file1 -rw-r--r--. 1 root root 0 Sep 27 11:43 file10 -rw-r--r--. 1 root root 0 Sep 27 11:43 file11 -rw-r--r--. 1 root root 0 Sep 27 11:43 file12 -rw-r--r--. 1 root root 0 Sep 27 11:43 file13 -rw-r--r--. 1 root root 0 Sep 27 11:43 file14 -rw-r--r--. 1 root root 0 Sep 27 11:43 file15 -rw-r--r--. 1 root root 0 Sep 27 11:43 file16 -rw-r--r--. 1 root root 0 Sep 27 11:43 file17 -rw-r--r--. 1 root root 0 Sep 27 11:43 file18 -rw-r--r--. 1 root root 0 Sep 27 11:43 file19 -rw-r--r--. 1 root root 0 Sep 27 11:43 file2 -rw-r--r--. 1 root root 0 Sep 27 11:43 file20 -rw-r--r--. 1 root root 0 Sep 27 11:43 file3 -rw-r--r--. 1 root root 0 Sep 27 11:43 file4 -rw-r--r--. 1 root root 0 Sep 27 11:43 file5 -rw-r--r--. 1 root root 0 Sep 27 11:43 file6 -rw-r--r--. 1 root root 0 Sep 27 11:43 file7 -rw-r--r--. 1 root root 0 Sep 27 11:43 file8 -rw-r--r--. 1 root root 0 Sep 27 11:43 file9
Important - Note that not only does the -a option of the rsync command synchronize files in a recursive manner, as does the -r option, but it also preserves special files, symbolic links, permissions, owners, groups as well as file modification dates.
Again, delete the files in the /test/dirB directory:
[root@redhat9 ~]# rm -rf /test/dirB/* [root@redhat9 ~]# ls -l /test/dirB/ total 0
Now run the following command and see the result:
[root@redhat9 ~]# rsync -a /test/dirA /test/dirB [root@redhat9 ~]# ls -l /test/dirB/ total 4 drwxr-xr-x. 2 root root 4096 Sep 27 11:43 dirA [root@redhat9 ~]# ls -l /test/dirB/dirA/ total 0 -rw-r--r--. 1 root root 0 Sep 27 11:43 file1 -rw-r--r--. 1 root root 0 Sep 27 11:43 file10 -rw-r--r--. 1 root root 0 Sep 27 11:43 file11 -rw-r--r--. 1 root root 0 Sep 27 11:43 file12 -rw-r--r--. 1 root root 0 Sep 27 11:43 file13 -rw-r--r--. 1 root root 0 Sep 27 11:43 file14 -rw-r--r--. 1 root root 0 Sep 27 11:43 file15 -rw-r--r--. 1 root root 0 Sep 27 11:43 file16 -rw-r--r--. 1 root root 0 Sep 27 11:43 file17 -rw-r--r--. 1 root root 0 Sep 27 11:43 file18 -rw-r--r--. 1 root root 0 Sep 27 11:43 file19 -rw-r--r--. 1 root root 0 Sep 27 11:43 file2 -rw-r--r--. 1 root root 0 Sep 27 11:43 file20 -rw-r--r--. 1 root root 0 Sep 27 11:43 file3 -rw-r--r--. 1 root root 0 Sep 27 11:43 file4 -rw-r--r--. 1 root root 0 Sep 27 11:43 file5 -rw-r--r--. 1 root root 0 Sep 27 11:43 file6 -rw-r--r--. 1 root root 0 Sep 27 11:43 file7 -rw-r--r--. 1 root root 0 Sep 27 11:43 file8 -rw-r--r--. 1 root root 0 Sep 27 11:43 file9
Important - Note that in this case, the / character is missing after dirA in the rsync -a /test/dirA /test/dirB command. The result is synchronisation of the directory /test/dirA to /test/dirB.
To avoid errors, the rsync command allows you to view the result of your command without executing the command by using the -n and -r options.
Again, delete the files in the /test/dirB directory:
[root@redhat9 ~]# rm -rf /test/dirB/* [root@redhat9 ~]# ls -l /test/dirB/ total 0
Run the command below:
[root@redhat9 ~]# rsync -anv /test/dirA/ /test/dirB sending incremental file list ./ file1 file10 file11 file12 file13 file14 file15 file16 file17 file18 file19 file2 file20 file3 file4 file5 file6 file7 file8 file9 sent 387 bytes received 79 bytes 932.00 bytes/sec total size is 0 speedup is 0.00 (DRY RUN) [root@redhat9 ~]# ls -l /test/dirB/ total 0
Important - Note that in this case, the result of the synchronisation is to send the contents of the /test/dirA directory to /test/dirB.
Now run the command below:
[root@redhat9 ~]# rsync -anv /test/dirA /test/dirB sending incremental file list dirA/ dirA/file1 dirA/file10 dirA/file11 dirA/file12 dirA/file13 dirA/file14 dirA/file15 dirA/file16 dirA/file17 dirA/file18 dirA/file19 dirA/file2 dirA/file20 dirA/file3 dirA/file4 dirA/file5 dirA/file6 dirA/file7 dirA/file8 dirA/file9 sent 397 bytes received 80 bytes 954.00 bytes/sec total size is 0 speedup is 0.00 (DRY RUN) [root@redhat9 ~]# ls -l /test/dirB/ total 0
Important - Note that in this case, the result of the synchronisation is to send the /test/dirA directory to /test/dirB.
Command Line Switches
The options for the rsync command are:
[root@redhat9 ~]# rsync --help rsync version 3.2.3 protocol version 31 Copyright (C) 1996-2020 by Andrew Tridgell, Wayne Davison, and others. Web site: https://rsync.samba.org/ Capabilities: 64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints, socketpairs, hardlinks, hardlink-specials, symlinks, IPv6, atimes, batchfiles, inplace, append, ACLs, xattrs, optional protect-args, iconv, symtimes, prealloc, stop-at, no crtimes Optimisations: SIMD, asm, openssl-crypto Checksum list: md5 md4 none Compress list: zstd lz4 zlibx zlib none rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See the GNU General Public Licence for details. rsync is a file transfer program capable of efficient remote update via a fast differencing algorithm. Usage: rsync [OPTION]... SRC [SRC]... DEST or rsync [OPTION]... SRC [SRC]... [USER@]HOST:DEST or rsync [OPTION]... SRC [SRC]... [USER@]HOST::DEST or rsync [OPTION]... SRC [SRC]... rsync://[USER@]HOST[:PORT]/DEST or rsync [OPTION]... [USER@]HOST:SRC [DEST] or rsync [OPTION]... [USER@]HOST::SRC [DEST] or rsync [OPTION]... rsync://[USER@]HOST[:PORT]/SRC [DEST] The ‘:’ usages connect via remote shell, while ‘::’ & ‘rsync://’ usages connect to an rsync daemon, and require SRC or DEST to start with a module name. Options --verbose, -v increase verbosity --info=FLAGS fine-grained informational verbosity --debug=FLAGS fine-grained debug verbosity --stderr=e|a|c change stderr output mode (default: errors) --quiet, -q suppress non-error messages --no-motd suppress daemon-mode MOTD --checksum, -c skip based on checksum, not mod-time & size --archive, -a archive mode; equals -rlptgoD (no -H,-A,-X) --no-OPTION turn off an implied OPTION (e.g. --no-D) --recursive, -r recurse into directories --relative, -R use relative path names --no-implied-dirs don't send implied dirs with --relative --backup, -b make backups (see --suffix & --backup-dir) --backup-dir=DIR make backups into hierarchy based in DIR --suffix=SUFFIX backup suffix (default ~ w/o --backup-dir) --update, -u skip files that are newer on the receiver --inplace update destination files in-place --append append data onto shorter files --append-verify --append w/old data in file checksum --dirs, -d transfer directories without recursing --mkpath create the destination's path component --links, -l copy symlinks as symlinks --copy-links, -L transform symlink into referent file/dir --copy-unsafe-links only ‘unsafe’ symlinks are transformed --safe-links ignore symlinks that point outside the tree --munge-links munge symlinks to make them safe & unusable --copy-dirlinks, -k transform symlink to dir into referent dir --keep-dirlinks, -K treat symlinked dir on receiver as dir --hard-links, -H preserve hard links --perms, -p preserve permissions --executability, -E preserve executability --chmod=CHMOD affect file and/or directory permissions --acls, -A preserve ACLs (implies --perms) --xattrs, -X preserve extended attributes --owner, -o preserve owner (super-user only) --group, -g preserve group --devices preserve device files (super-user only) --copy-devices copy device contents as regular file --specials preserve special files -D same as --devices --specials --times, -t preserve modification times --atimes, -U preserve access (use) times --open-noatime avoid changing the atime on opened files --crtimes, -N preserve create times (newness) --omit-dir-times, -O omit directories from --times --omit-link-times, -J omit symlinks from --times --super receiver attempts super-user activities --fake-super store/recover privileged attrs using xattrs --sparse, -S turn sequences of nulls into sparse blocks --preallocate allocate dest files before writing them --write-devices write to devices as files (implies --inplace) --dry-run, -n perform a trial run with no changes made --whole-file, -W copy files whole (w/o delta-xfer algorithm) --checksum-choice=STR choose the checksum algorithm (aka --cc) --one-file-system, -x don't cross filesystem boundaries --block-size=SIZE, -B force a fixed checksum block-size --rsh=COMMAND, -e specify the remote shell to use --rsync-path=PROGRAM specify the rsync to run on remote machine --existing skip creating new files on receiver --ignore-existing skip updating files that exist on receiver --remove-source-files sender removes synchronized files (non-dir) --del an alias for --delete-during --delete delete extraneous files from dest dirs --delete-before receiver deletes before xfer, not during --delete-during receiver deletes during the transfer --delete-delay find deletions during, delete after --delete-after receiver deletes after transfer, not during --delete-excluded also delete excluded files from dest dirs --ignore-missing-args ignore missing source args without error --delete-missing-args delete missing source args from destination --ignore-errors delete even if there are I/O errors --force force deletion of dirs even if not empty --max-delete=NUM don't delete more than NUM files --max-size=SIZE don't transfer any file larger than SIZE --min-size=SIZE don't transfer any file smaller than SIZE --max-alloc=SIZE change a limit relating to memory alloc --partial keep partially transferred files --partial-dir=DIR put a partially transferred file into DIR --delay-updates put all updated files into place at end --prune-empty-dirs, -m prune empty directory chains from file-list --numeric-ids don't map uid/gid values by user/group name --usermap=STRING custom username mapping --groupmap=STRING custom groupname mapping --chown=USER:GROUP simple username/groupname mapping --timeout=SECONDS set I/O timeout in seconds --contimeout=SECONDS set daemon connection timeout in seconds --ignore-times, -I don't skip files that match size and time --size-only skip files that match in size --modify-window=NUM, -@ set the accuracy for mod-time comparisons --temp-dir=DIR, -T create temporary files in directory DIR --fuzzy, -y find similar file for basis if no dest file --compare-dest=DIR also compare destination files relative to DIR --copy-dest=DIR ... and include copies of unchanged files --link-dest=DIR hardlink to files in DIR when unchanged --compress, -z compress file data during the transfer --compress-choice=STR choose the compression algorithm (aka --zc) --compress-level=NUM explicitly set compression level (aka --zl) --skip-compress=LIST skip compressing files with suffix in LIST --cvs-exclude, -C auto-ignore files in the same way CVS does --filter=RULE, -f add a file-filtering RULE -F same as --filter=‘dir-merge /.rsync-filter’ repeated: --filter=‘- .rsync-filter’ --exclude=PATTERN exclude files matching PATTERN --exclude-from=FILE read exclude patterns from FILE --include=PATTERN don't exclude files matching PATTERN --include-from=FILE read include patterns from FILE --files-from=FILE read list of source-file names from FILE --from0, -0 all *-from/filter files are delimited by 0s --protect-args, -s no space-splitting; wildcard chars only --copy-as=USER[:GROUP] specify user & optional group for the copy --address=ADDRESS bind address for outgoing socket to daemon --port=PORT specify double-colon alternate port number --sockopts=OPTIONS specify custom TCP options --blocking-io use blocking I/O for the remote shell --outbuf=N|L|B set out buffering to None, Line, or Block --stats give some file-transfer stats --8-bit-output, -8 leave high-bit chars unescaped in output --human-readable, -h output numbers in a human-readable format --progress show progress during transfer -P same as --partial --progress --itemize-changes, -i output a change-summary for all updates --remote-option=OPT, -M send OPTION to the remote side only --out-format=FORMAT output updates using the specified FORMAT --log-file=FILE log what we're doing to the specified FILE --log-file-format=FMT log updates using the specified FMT --password-file=FILE read daemon-access password from FILE --early-input=FILE use FILE for daemon's early exec input --list-only list the files instead of copying them --bwlimit=RATE limit socket I/O bandwidth --stop-after=MINS Stop rsync after MINS minutes have elapsed --stop-at=y-m-dTh:m Stop rsync at the specified point in time --write-batch=FILE write a batched update to FILE --only-write-batch=FILE like --write-batch but w/o updating dest --read-batch=FILE read a batched update from FILE --protocol=NUM force an older protocol version to be used --iconv=CONVERT_SPEC request charset conversion of filenames --checksum-seed=NUM set block/file checksum seed (advanced) --ipv4, -4 prefer IPv4 --ipv6, -6 prefer IPv6 --version, -V print the version + other info and exit --help, -h (*) show this help (* -h is help only on its own) Use ‘rsync --daemon --help’ to see the daemon-mode command-line options. Please see the rsync(1) and rsyncd.conf(5) man pages for full documentation. See https://rsync.samba.org/ for updates, bug reports, and answers
Compression
The gzip command
Overview
The gzip command is a compression utility under GNU/Linux. The gunzip command is a GNU/Linux decompression utility.
Command Line Switches
The gzip Command Line Switches are:
[root@redhat9 ~]# gzip --help Usage: gzip [OPTION]... [FILE]... Compress or uncompress FILEs (by default, compress FILES in-place). Mandatory arguments to long options are mandatory for short options too. -c, --stdout write on standard output, keep original files unchanged -d, --decompress decompress -f, --force force overwrite of output file and compress links -h, --help give this help -k, --keep keep (don't delete) input files -l, --list list compressed file contents -L, --license display software license -n, --no-name do not save or restore the original name and timestamp -N, --name save or restore the original name and timestamp -q, --quiet suppress all warnings -r, --recursive operate recursively on directories --rsyncable make rsync-friendly archive -S, --suffix=SUF use suffix SUF on compressed files --synchronous synchronous output (safer if system crashes, but slower) -t, --test test compressed file integrity -v, --verbose verbose mode -V, --version display version number -1, --fast compress faster -9, --best compress better With no FILE, or when FILE is -, read standard input. Report bugs to <bug-gzip@gnu.org>.
The options for the gunzip command are:
[root@redhat9 ~]# gunzip --help Usage: /usr/bin/gunzip [OPTION]... [FILE]... Uncompress FILEs (by default, in-place). Mandatory arguments to long options are mandatory for short options too. -c, --stdout write on standard output, keep original files unchanged -f, --force force overwrite of output file and compress links -k, --keep keep (don't delete) input files -l, --list list compressed file contents -n, --no-name do not save or restore the original name and timestamp -N, --name save or restore the original name and timestamp -q, --quiet suppress all warnings -r, --recursive operate recursively on directories -S, --suffix=SUF use suffix SUF on compressed files --synchronous synchronous output (safer if system crashes, but slower) -t, --test test compressed file integrity -v, --verbose verbose mode --help display this help and exit --version display version information and exit With no FILE, or when FILE is -, read standard input. Report bugs to <bug-gzip@gnu.org>.
LAB #6 - Working with the gzip command
Use gzip to compress your tar file:
[root@redhat9 ~]# gzip /tmp/test.tar
Note the size of the test.tar.gz file:
[root@redhat9 ~]# ls -l /tmp/test.tar.gz -rw-r--r--. 1 root root 222 Sep 27 07:57 /tmp/test.tar.gz
Important - Note that the compressed file was created in the same directory as the source file and that the source file has disappeared.
Unzip the test.tar.gz file:
[root@redhat9 ~]# gunzip /tmp/test.tar.gz
The bzip2 command
Overview
The bzip2 command is a compression utility under GNU/Linux. The bunzip2 command is a decompression utility under GNU/Linux.
Command Line Switches
The options for the bzip2 command are:
[root@redhat9 ~]# bzip2 --help bzip2, a block-sorting file compressor. Version 1.0.8, 13-Jul-2019. usage: bzip2 [flags and input files in any order] -h --help print this message -d --decompress force decompression -z --compress force compression -k --keep keep (don't delete) input files -f --force overwrite existing output files -t --test test compressed file integrity -c --stdout output to standard out -q --quiet suppress noncritical error messages -v --verbose be verbose (a 2nd -v gives more) -L --license display software version & license -V --version display software version & license -s --small use less memory (at most 2500k) -1 .. -9 set block size to 100k .. 900k --fast alias for -1 --best alias for -9 If invoked as `bzip2', default action is to compress. as `bunzip2', default action is to decompress. as `bzcat', default action is to decompress to stdout. If no file names are given, bzip2 compresses or decompresses from standard input to standard output. You can combine short flags, so `-v -4' means the same as -v4 or -4v, &c.
The options for the bunzip2 command are:
[root@redhat9 ~]# bunzip2 --help bzip2, a block-sorting file compressor. Version 1.0.8, 13-Jul-2019. usage: bunzip2 [flags and input files in any order] -h --help print this message -d --decompress force decompression -z --compress force compression -k --keep keep (don't delete) input files -f --force overwrite existing output files -t --test test compressed file integrity -c --stdout output to standard out -q --quiet suppress noncritical error messages -v --verbose be verbose (a 2nd -v gives more) -L --license display software version & license -V --version display software version & license -s --small use less memory (at most 2500k) -1 .. -9 set block size to 100k .. 900k --fast alias for -1 --best alias for -9 If invoked as `bzip2', default action is to compress. as `bunzip2', default action is to decompress. as `bzcat', default action is to decompress to stdout. If no file names are given, bzip2 compresses or decompresses from standard input to standard output. You can combine short flags, so `-v -4' means the same as -v4 or -4v, &c.0
LAB #7 - Working with the bzip2 command
Use bzip2 to compress your tar file:
[root@redhat9 ~]# bzip2 /tmp/test.tar
Note the size of the tar.bz2 file:
[root@redhat9 ~]# ls -l /tmp | grep test.tar.bz -rw-r--r--. 1 root root 207 Sep 27 07:57 test.tar.bz2
Important - Note that the compressed file was created in the same directory as the source file and the source file has disappeared.
Unzip the tar.bz2 file:
[root@redhat9 ~]# bunzip2 /tmp/test.tar.bz2
The xz command
Overview
The xz command is a compression utility under GNU/Linux. Other commands are:
- unxz - equivalent to xz –decompress.
- xzcat - equivalent to xz –decompress –stdout.
- lzma - equivalent to xz –format=lzma.
- unlzma - equivalent to xz –format=lzma –decompress.
- lzcat - equivalent to xz –format=lzma –decompress –stdout.
The xz command will not compress the file if :
- the file is not of standard type
- the file is a symbolic link
- the file is a physical link
- the file has a sticky bit, SUID bit or SGID bit
- the file already has an .xz or .lzma extension
The xz command will not decompress the file if :
- the file does not have an .xz or .lzma extension
Command Line Switches
The options for the xz command are:
[root@redhat9 ~]# xz --help Usage: xz [OPTION]... [FILE]... Compress or decompress FILEs in the .xz format. -z, --compress force compression -d, --decompress force decompression -t, --test test compressed file integrity -l, --list list information about .xz files -k, --keep keep (don't delete) input files -f, --force force overwrite of output file and (de)compress links -c, --stdout write to standard output and don't delete input files -0 ... -9 compression preset; default is 6; take compressor *and* decompressor memory usage into account before using 7-9! -e, --extreme try to improve compression ratio by using more CPU time; does not affect decompressor memory requirements -T, --threads=NUM use at most NUM threads; the default is 1; set to 0 to use as many threads as there are processor cores -q, --quiet suppress warnings; specify twice to suppress errors too -v, --verbose be verbose; specify twice for even more verbose -h, --help display this short help and exit -H, --long-help display the long help (lists also the advanced options) -V, --version display the version number and exit With no FILE, or when FILE is -, read standard input. Report bugs to <lasse.collin@tukaani.org> (in English or Finnish). XZ Utils home page: <https://tukaani.org/xz/>
LAB #8 - Working with the xz command
Use xz to compress your tar file :
[root@redhat9 ~]# xz /tmp/test.tar
Important - Note that the default operation of the command is identical to that of the -z option.
Note the presence of the test.tar.xz file:
[root@redhat9 ~]# ls -l /tmp | grep test.tar.xz -rw-r--r--. 1 root root 236 Sep 27 07:57 test.tar.xz
Important - Note that the compressed file was created in the same directory as the source file and that the source file has disappeared. The source file can be maintained if the –keep option is specified. If the test.tar.xz file had already existed, the command would have failed with an error message. The file extension is .xz, however the command can also handle the .lzma extension.
Unzip the test.tar.xz file:
[root@redhat9 ~]# xz -d /tmp/test.tar.xz [root@redhat9 ~]# ls -l /tmp | grep test -rw-r--r--. 1 root root 160 Sep 25 16:05 greptest -rw-r--r--. 1 root root 49 Sep 25 16:05 greptest1 -rw-r--r--. 1 root root 687556 Sep 25 16:08 sedtest -rw-r--r--. 1 root root 512 Sep 27 08:08 test.cpio -rw-r--r--. 1 root root 10240 Sep 27 07:57 test.tar
Other Utilities
There are other utilities for compression, each producing a file with a specific extension:
Tool | Extension | Compression command | Decompression command |
---|---|---|---|
compress | .Z | compress | uncompress |
rar | .rar | rar | unrar |
zip | .zip | zip | unzip |
Copyright © 2024 Hugh Norris.