Click here to view code image
matthew@seymour:~$ sudo cp -avR directory_to_backup
destination_vol_or_dir 1 > /root/backup_log.txt
You can get the same effect this way:
Click here to view code image
matthew@seymour:~$ sudo cp -avR ubuntu /test2 1 >
/root/backup_log.txt
This example makes an exact copy of the directory named /ubuntu on the
volume named /test2 and saves a backup report named
backup_log.txt under /root.
Copying Files Using mc
The Midnight Commander is a command-line file manager that is useful for
copying, moving, and archiving files and directories. (It is available in the
Universe repository, under the package mc; see Chapter 9, “Managing
Software,” for how to enable the Universe and Multiverse repositories.) The
Midnight Commander looks and feels similar to the Norton Commander of
DOS fame. When you execute mc at a shell prompt, a dual-pane view of the
files is displayed. It contains drop-down menu choices and function keys for
manipulating files. It also uses its own virtual file system, enabling it to
mount FTP directories and display the contents of tar files, gzip tar files
(.tar.gz or .tgz), bzip files, DEB files, and RPM files, as well as extract
individual files from them. As if that were not enough, mc contains a File
Undelete virtual file system for ext2/3 partitions. By using cd to “change
directories” to an FTP server’s URL, you can transfer files using FTP. The
default font chosen for Ubuntu makes the display of mc ugly when used in a
tty console (as opposed to an xterm) but does not affect its performance.
In the interface, pressing the F9 key drops down the menu, and pressing F1
displays the Help file. A “feature” in the default GNOME terminal intercepts
the F10 key used to exit mc, so use F9 instead to access the menu item to quit
or just click the menu bar at the bottom with your mouse. The configuration
files are well documented, and it is easy to extend the functionality of mc for
your system if you understand shell scripting and regular expressions. It is an
excellent choice for file management on servers not running X.