The simplest backup you can do on your system is to duplicate the files individually using cp or pax.
For example, to duplicate a single file:
cp -t my_file backup_directory
or:
echo my_file | pax -rw backup_directory
To back up an entire directory, type:
cp -Rt my_directory backup_directory
or:
find my_directory -print | pax -rw backup_directory
To back up only certain files matching some criteria, use the find utility or other means of identifying the files to be backed up, and pipe the output to pax -rw, like this:
find my_directory -name '*.[ch]' | pax -rw backup_directory
To combine individual files into a single archive, use tar or pax. These utilities take all the files that you give them and place them into one big contiguous file. You can use the same utilities to extract discrete files from the archives.
When you use pax as an archiver (pax -w mode), it writes tar-format archives. Your choice of which to use is based on the command-line syntax that works better for you, not the format of the archives, because the formats are identical. The pax utility was created as part of the POSIX standard to provide a consistent mechanism for archive exchange (pax stands for Portable Archive eXchange), thus avoiding conflict between variants of the tar utility that behave differently.
You can create archives of:
pax -wf my_archive.tar code.c
This command takes code.c and creates an archive (sometimes referred to as a "tarball") called my_archive.tar. The -wf options tell pax to write a file.
pax -wf my_archive.tar code.c header.h readme.txt
Pax archives them all together resulting in the archive, my_archive.tar.
pax -wf my_archive.tar workspace
This command archives all the contents of workspace into my_archive.tar.
pax -wf my_archive.tar /fs/hd0-t79
This command archives all the contents of the t79 partition into one very large archive, my_archive.tar.
You can keep the archive on your local system, but we recommend that you keep a copy of it on a remote system; if the local system gets physically damaged, or the hard disk is corrupted, you'll lose a local archive.