• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

dar Command Examples in Linux

by admin

dar is a full-featured backup tool, aimed for disks (floppy, CD-R(W), DVD-R(W), zip, jazz, hard disks, usb keys, etc.). The dar (“disk archiver”) command is intended to replace tar by offering more backup and archiving functionality. It is especially useful at creating full, differential, and incremental backups.

dar Command Examples

1. The following command creates a full backup of the mydata directory and outputs a backup file named full.bak:

# dar -R mydata -c full.bak

2. To create a differential backup (diff1.bak), you can reference the full backup using the -A option:

# dar -R mydata -c diff1.bak -A full.bak

3. You can then create more differential backups as needed by referencing the full backup with the -A option. However, to perform incremental backups instead, you need to reference the previous incremental backup, like so:

# dar -R mydata -c incr1.bak -A full.bak
# dar -R mydata -c incr2.bak -A incr1.bak

4. The -x (extract) option is used to recover a backup. If you performed differential backups, you need to first extract the full backup, then the latest differential backup:

# dar -x full.bak
# dar -x diff1.bak -w

5. The -w option automatically overwrites changes to files; otherwise, you will be prompted to confirm. To recover an incremental backup, you need to first extract the full backup, then each incremental backup, in order:

# dar -x full.bak
# dar -x incr1.bak -w
# dar -x incr2.bak -w

Filed Under: Linux

Some more articles you might also be interested in …

  1. Understanding Samba utilities – nmblookup, smbstatus, smbtar, testparm, wbinfo, smbget
  2. CentOS / RHEL 6 : How to password protect grub (Password-Protected Booting)
  3. How to Change runlevels/targets using systemd in Ubuntu
  4. create_ap: command not found
  5. Why Does a Lun World Wide ID Starts with the Number 3 in Linux dm-multipath
  6. timeshift: command not found
  7. IBM DB2 Installation on Red Hat Enterprise Linux
  8. CentOS / RHEL 7 : How to disable Transparent Huge pages (THP)
  9. “az tag” Command Examples (Manage tags on a resource)
  10. Understanding the job control commands in Linux – bg, fg and CTRL+Z

You May Also Like

Primary Sidebar

Recent Posts

  • csslint: A linter for CSS code
  • csh: The shell (command interpreter) with C-like syntax (Command Examples)
  • csc: The Microsoft C# Compiler (Command Examples)
  • crystal: Tool for managing Crystal source code

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright