Linux Format

Employ caution when employing the dd command…

-

Using the dd command can actually destroy data as opposed to recovering it, but only if used incorrectl­y. An example of the proper usage can be found in this command # dd if=/dev/target_ partition of=/home/user/partition.image . The if=/ part of the command must be first in executing the command and never the of part. An easy way to remember this is by thinking about the alphabet. I is before O so execute the if section before the of section.

Other examples of the dd command are as follows. # dd if=/dev/sda of=/dev/sdb would back up the entire contents of /dev/sda/ to drive /dev/sdb/ , but just be sure to verify the drive with the lsblk command.

You could even create a Cron job with a BASH shell script to run and make regular backups at an interval of your choosing. Just make sure that the second drive has the required space for creating a backup.

Cron is a job scheduler that enables you to deal with repetitive system tasks. For a one-off job you can use the at utility. Cron is powered by crontab or a crontable, and this tells the system what commands to run and when. This example command 1 0 ** * printf > /var/log/

apache/error_log would clear an apache error log at one minute past midnight every day. Note that only if the default shell for the Cron user is BASH compliant.

Newspapers in English

Newspapers from Australia