How to Save Command Output to a File in Linux

There are many things you can do with the output of a command in Linux. You can assign the output of a command to a variable, send it to another command/program for processing through a pipe or redirect it to a file for further analysis.

Suggested Read: Learn The Basics of How Linux I/O (Input/Output) Redirection Works

In this short article, I will show you a simple but useful command-line trick: how to view output of a command on the screen and also write to a file in Linux.

Viewing Output On Screen and also Writing to a File

Assuming you want to get a full summary of available and used disk space of a file system on a Linux system, you can employ the df command; it also helps you determine the file system type on a partition.

$ $df

Check Filesystem Disk Space

Check Filesystem Disk Space

With the -h flag, you can show the file system disk space statistics in a “human readable” format (displays statistics details in bytes, mega bytes and gigabyte).

$ df -h

Disk Space in Human Readable Format

Disk Space in Human Readable Format

Now to display the above information on the screen and also write it to a file, say for later analysis and/or send to a system administrator via email, run the command below.

$ df -h | tee df.log
$ cat df.log

Linux Command Output to File

Linux Command Output to File

Here, the magic is done by the tee command, it reads from standard input and writes to standard output as well as files.

If a file(s) already exists, you can append it using the -a or --append option like this.

$ df -h | tee -a df.log 

Note: You can also use pydf an alternative “df” command to check disk usage in different colors.

For more information, read through the df and tee man pages.

$ man df
$ man tee

You may also like to read similar articles.

  1. 5 Interesting Command Line Tips and Tricks in Linux
  2. 10 Useful Linux Command Line Tricks for Newbies
  3. 10 Interesting Linux Command Line Tricks and Tips Worth Knowing
  4. How to Run or Repeat a Linux Command Every X Seconds Forever
  5. Set Date and Time for Each Command You Execute in Bash History

In this short article, I showed you how to view output of a command on the screen and also write to a file in Linux. If you have any questions or additional ideas to share, do that via the comment section below.

Source

How to Use ‘find’ Command to Search for Multiple Filenames (Extensions) in Linux

Many times, we are locked in a situation where we have to search for multiple files with different extensions, this has probably happened to several Linux users especially from within the terminal.

There are several Linux utilities that we can use to locate or find files on the file system, but finding multiple filenames or files with different extensions can sometimes prove tricky and requires specific commands.

Find Multiple File Names in Linux

Find Multiple File Names in Linux

One of the many utilities for locating files on a Linux file system is the find utility and in this how-to guide, we shall walk through a few examples of using find to help us locate multiple filenames at once.

Before we dive into the actual commands, let us look at a brief introduction to the Linux find utility.

The simplest and general syntax of the find utility is as follows:

# find directory options [ expression ]

Let us proceed to look at some examples of find command in Linux.

1. Assuming that you want to find all files in the current directory with .sh and .txt file extensions, you can do this by running the command below:

# find . -type f \( -name "*.sh" -o -name "*.txt" \)

Find .sh and .txt Extension Files in Linux

Find .sh and .txt Extension Files in Linux

Interpretation of the command above:

  1. . means the current directory
  2. -type option is used to specify file type and here, we are searching for regular files as represented by f
  3. -name option is used to specify a search pattern in this case, the file extensions
  4. -o means “OR”

It is recommended that you enclose the file extensions in a bracket, and also use the \ ( back slash) escape character as in the command.

2. To find three filenames with .sh.txt and .c extensions, issues the command below:

# find . -type f \( -name "*.sh" -o -name "*.txt" -o -name "*.c" \)

Find Multiple File Extensions in Linux

Find Multiple File Extensions in Linux

3. Here is another example where we search for files with .png.jpg.deb and .pdf extensions:

# find /home/aaronkilik/Documents/ -type f \( -name "*.png" -o -name "*.jpg" -o -name "*.deb" -o -name ".pdf" \)

Find More than 3 File Extensions in Linux

Find More than 3 File Extensions in Linux

When you critically observe all the commands above, the little trick is using the -o option in the find command, it enables you to add more filenames to the search array, and also knowing the filenames or file extensions you are searching for.

Conclusion

In this guide, we covered a simple yet helpful find utility trick to enable us find multiple filenames by issuing a single command. To understand and use find for many other vital command line operations, you can read our article below.

35 Practical Examples of Linux Find Command

The Linux Find Command is one of the most important and much used command in Linux sytems. Find command used to search and locate list of files and directories based on conditions you specify for files that match the arguments. Find can be used in variety of conditions like you can find files by permissionsusersgroupsfile typedatesize and other possible criteria.

Linux Find Command

35 Linux Find Commands Examples

Through this article we are sharing our day-to-day Linux find command experience and its usage in the form of examples. In this article we will show you the most used 35 Find Commands examples in Linux. We have divided the section into Five parts from basic to advance usage of find command.

  1. Part I: Basic Find Commands for Finding Files with Names
  2. Part II: Find Files Based on their Permissions
  3. Part III: Search Files Based On Owners and Groups
  4. Part IV: Find Files and Directories Based on Date and Time
  5. Part V: Find Files and Directories Based on Size
  6. Part VIFind Multiple Filenames in Linux
Part I – Basic Find Commands for Finding Files with Names

1. Find Files Using Name in Current Directory

Find all the files whose name is tecmint.txt in a current working directory.

# find . -name tecmint.txt

./tecmint.txt

2. Find Files Under Home Directory

Find all the files under /home directory with name tecmint.txt.

# find /home -name tecmint.txt

/home/tecmint.txt

3. Find Files Using Name and Ignoring Case

Find all the files whose name is tecmint.txt and contains both capital and small letters in /home directory.

# find /home -iname tecmint.txt

./tecmint.txt
./Tecmint.txt

4. Find Directories Using Name

Find all directories whose name is Tecmint in / directory.

# find / -type d -name Tecmint

/Tecmint

5. Find PHP Files Using Name

Find all php files whose name is tecmint.php in a current working directory.

# find . -type f -name tecmint.php

./tecmint.php

6. Find all PHP Files in Directory

Find all php files in a directory.

# find . -type f -name "*.php"

./tecmint.php
./login.php
./index.php
Part II – Find Files Based on their Permissions

7. Find Files With 777 Permissions

Find all the files whose permissions are 777.

# find . -type f -perm 0777 -print

8. Find Files Without 777 Permissions

Find all the files without permission 777.

# find / -type f ! -perm 777

9. Find SGID Files with 644 Permissions

Find all the SGID bit files whose permissions set to 644.

# find / -perm 2644

10. Find Sticky Bit Files with 551 Permissions

Find all the Sticky Bit set files whose permission are 551.

# find / -perm 1551

11. Find SUID Files

Find all SUID set files.

# find / -perm /u=s

12. Find SGID Files

Find all SGID set files.

# find / -perm /g=s

13. Find Read Only Files

Find all Read Only files.

# find / -perm /u=r

14. Find Executable Files

Find all Executable files.

# find / -perm /a=x

15. Find Files with 777 Permissions and Chmod to 644

Find all 777 permission files and use chmod command to set permissions to 644.

# find / -type f -perm 0777 -print -exec chmod 644 {} \;

16. Find Directories with 777 Permissions and Chmod to 755

Find all 777 permission directories and use chmod command to set permissions to 755.

# find / -type d -perm 777 -print -exec chmod 755 {} \;

17. Find and remove single File

To find a single file called tecmint.txt and remove it.

# find . -type f -name "tecmint.txt" -exec rm -f {} \;

18. Find and remove Multiple File

To find and remove multiple files such as .mp3 or .txt, then use.

# find . -type f -name "*.txt" -exec rm -f {} \;

OR

# find . -type f -name "*.mp3" -exec rm -f {} \;

19. Find all Empty Files

To find all empty files under certain path.

# find /tmp -type f -empty

20. Find all Empty Directories

To file all empty directories under certain path.

# find /tmp -type d -empty

21. File all Hidden Files

To find all hidden files, use below command.

# find /tmp -type f -name ".*"
Part III – Search Files Based On Owners and Groups

22. Find Single File Based on User

To find all or single file called tecmint.txt under / root directory of owner root.

# find / -user root -name tecmint.txt

23. Find all Files Based on User

To find all files that belongs to user Tecmint under /home directory.

# find /home -user tecmint

24. Find all Files Based on Group

To find all files that belongs to group Developer under /home directory.

# find /home -group developer

25. Find Particular Files of User

To find all .txt files of user Tecmint under /home directory.

# find /home -user tecmint -iname "*.txt"
Part IV – Find Files and Directories Based on Date and Time

26. Find Last 50 Days Modified Files

To find all the files which are modified 50 days back.

# find / -mtime 50

27. Find Last 50 Days Accessed Files

To find all the files which are accessed 50 days back.

# find / -atime 50

28. Find Last 50-100 Days Modified Files

To find all the files which are modified more than 50 days back and less than 100 days.

# find / -mtime +50 –mtime -100

29. Find Changed Files in Last 1 Hour

To find all the files which are changed in last 1 hour.

# find / -cmin -60

30. Find Modified Files in Last 1 Hour

To find all the files which are modified in last 1 hour.

# find / -mmin -60

31. Find Accessed Files in Last 1 Hour

To find all the files which are accessed in last 1 hour.

# find / -amin -60
Part V – Find Files and Directories Based on Size

32. Find 50MB Files

To find all 50MB files, use.

# find / -size 50M

33. Find Size between 50MB – 100MB

To find all the files which are greater than 50MB and less than 100MB.

# find / -size +50M -size -100M

34. Find and Delete 100MB Files

To find all 100MB files and delete them using one single command.

# find / -size +100M -exec rm -rf {} \;

35. Find Specific Files and Delete

Find all .mp3 files with more than 10MB and delete them using one single command.

# find / -type f -name *.mp3 -size +10M -exec rm {} \;

That’s it, We are ending this post here, In our next article we will discuss more about other Linux commands in depth with practical examples. Let us know your opinions on this article using our comment section.

Source

How to Restore Deleted /tmp Directory in Linux

The /tmp directory contains mostly files that are required temporarily, it is used by different programs to create lock files and for temporary storage of data. Many of these files are important for currently running programs and deleting them may result in a system crash.

On all if not most Linux systems, the contents of the /tmp directory are deleted (cleared out) at boot time or at shutdown by the local system. This is a standard procedure for system administration, to reduce the amount of storage space used (typically, on a disk drive).

Important: Do not delete files from the /tmp directory unless you know exactly what you are doing! In multi-user systems, this can potentially remove active files, disrupting users activities (via programs they are using).

What if you accidentally delete the /tmp directory? In this article, we will show you how to restore (recreate) /tmp directory after deleting it.

Suggested Read: How to Recover Deleted Files in Linux

A few things to note before running the commands below.

  • the /tmp must belong to the root user.
  • set appropriate permissions that will allow all users to use this directory (make it public).
$ sudo mkdir /tmp 
$ sudo chmod 1777 /tmp

Alternatively, run this command.

$ sudo mkdir -m 1777 /tmp

Now run the command below to check the permissions of the directory.

$ ls -ld /tmp

Restore Deleted /tmp Directory in Linux

Restore Deleted /tmp Directory in Linux

The permission set here mean everybody (owner, group and others) can read, write and access files in the directory, and the t (sticky bit), implying files may only be deleted by their owner.

Note: Once you have restored the /tmp directory as shown above, it is recommended you reboot the system to ensure that all programs start operating normally.

That’s it! In this article, we showed how to restore (recreate) /tmp directory after deleting it accidentally in Linux. Drop your comments via the feedback form below.

Source

Fping – A High Performance Ping Tool for Linux

fping is a small command line tool to send ICMP (Internet Control Message Protocol) echo request to network hosts, similar to ping, but much higher performing when pinging multiple hosts. fping totally differs from ping in that you can define any number of hosts on the command line or specify a file with the list of IP addresses or hosts to ping.

Read AlsoA Linux Sysadmin’s Guide to Network Management, Troubleshooting and Debugging

For example, using fping, we can specify the complete network range (192.168.0.1/24). It will send Fping request to host and move to another target host in a round-robin fashion. Unlike ping, Fping is meant for basically scripting.

How to Install Fping in Linux Systems

In most Linux distributions, the package fping is available to install from the default package repositories using package management tool as shown.

# sudo apt install fping  [On Debian/Ubuntu]
# sudo yum install fping  [On CentOS/RHEL]
# sudo dnf install fping  [On Fedora 22+]
# sudo pacman -S fping    [On Arch Linux]

Alternatively, you can install latest version of fping (4.0) from the source package using following commands.

$ wget https://fping.org/dist/fping-4.0.tar.gz
$ tar -xvf fping-4.0.tar.gz
$ cd fping-4.0/
$ ./configure
$ make && make install

Let’s see some Fping command with their examples.

1. Fping Multiple IP Address

The below command will fping multiple IP address at once and it will display status as alive or unreachable.

# fping 50.116.66.139 173.194.35.35 98.139.183.24

50.116.66.139 is alive
173.194.35.35 is unreachable
98.139.183.24 is unreachable

2. Fping Range of IP Address

The following command will fping a specified range of IP addressees. With below output we are sending echo request to range of IP address and getting reply as we wanted. Also cumulative result shown after exit.

# fping -s -g 192.168.0.1 192.168.0.9

192.168.0.1 is alive
192.168.0.2 is alive
ICMP Host Unreachable from 192.168.0.2 for ICMP Echo sent to 192.168.0.3
ICMP Host Unreachable from 192.168.0.2 for ICMP Echo sent to 192.168.0.3
ICMP Host Unreachable from 192.168.0.2 for ICMP Echo sent to 192.168.0.3
ICMP Host Unreachable from 192.168.0.2 for ICMP Echo sent to 192.168.0.4
192.168.0.3 is unreachable
192.168.0.4 is unreachable

8      9 targets
       2 alive
       2 unreachable
       0 unknown addresses

       4 timeouts (waiting for response)
       9 ICMP Echos sent
       2 ICMP Echo Replies received
      2 other ICMP received

 0.10 ms (min round trip time)
 0.21 ms (avg round trip time)
 0.32 ms (max round trip time)
        4.295 sec (elapsed real time)

3. Fping Complete Network with Different Options

With above command, it will ping complete network and repeat once (-r 1). Sorry, it’s not possible to show output of the command as it is scrolling up my screen with no time.

# fping -g -r 1 192.168.0.0/24

4. Reads the List of Targets From a File

We have create a file called fping.txt having IP address (173.194.35.35 and 98.139.183.24) to fping.

# fping < fping.txt

173.194.35.35 is alive
98.139.183.24 is alive

5. Show Version of Fping

Check the Fping version by executing the command.

# fping -v

fping: Version 4.0
fping: comments to david@schweikert.ch

Those who want to get more information with options about Fping command, please look into a man page. Also requested to try Fping command in your environment and share your experience with us through the comment box below.

Source

8 Best Video Editing Softwares I Discovered for Linux

It has been a long known fact that there is a larger variety of software products for Windows and Macs compared to Linux. And even though Linux is continuously growing it is still hard to find some specific software. We know many of you like editing videos and that you often need to switch back to Windows in order to make some easy video editing tasks.

Best Linux Video Editing Softwares

8 Best Linux Video Editing Softwares

Don’t Miss: 15 Best Image Editors I Discovered for Linux

This is why we have gathered a list of the best Linux video editing software so you can easily manage your videos in Linux environment.

1. Open Shot

We start our list with OpenShot,is a feature rich, multiplatform video editor that can be used on Linux, Windows and Macs. OpenShot is written in Python and it supports many different audio and video formats and also includes drag-n-drop feature.

To get a better understanding of the features that OpenShot has, here is a more detailed list:

  1. Supports large variety of video, audio and image formats based on ffmpeg.
  2. Easy Gnome integration and support for drag and drop.
  3. Video resizing, scaling, trimming and cutting.
  4. Video transitions
  5. Include watermarks
  6. 3D animated titles
  7. Digital zooming
  8. Video effects
  9. Speed changes

Installation of OpenShot

The installation of this video editor is performed via PPA and it’s only supports Ubuntu 14.04 and above. To complete the installation, you can run the following commands:

$ sudo add-apt-repository ppa:openshot.developers/ppa
$ sudo apt-get update
$ sudo apt-get install openshot-qt

Once installed, OpenShort will be present in the applications menu.

OpenShot Video Editor

OpenShot Video Editor

2. Pitivi

Pitivi is another great free, open source video editing software. It uses Gstreamer framework for importing/exporting and rendering of media. Pitivi supports simple tasks such as:

  1. Trimming
  2. Cutting
  3. Snapping
  4. Splitting
  5. Mixing

Audio and video clips can be linked together and managed as single clip. Another thing that I personally find useful is that Pitivi can be used in different languages and has a very extended documentation. Learning how to use this software is easy and doesn’t require much time. Once you get used to it, you will be able to edit video and audio files with high precision.

Installation of Pitivi

Pitivi is available for download via the Ubuntu software manager or via:

$ sudo apt-get install pitivi

To install on other Linux distributions, you need to compile it from source using distro-agnostic all-in-one binary bundle, the only requirement is glibc 2.13 or higher.

Just download the distro-agnostic bundle, extract the executable file, and double-click on it launch.

Pitivi Video Editor

Pitivi Video Editor

3. Avidemux

Avidemux is another free open source video editing software. It was originally designed mainly for cutting, filtering and encoding tasks. Avidemux is available on Linux, Windows and Mac. It is ideal for the afford mentioned tasks, but if you want to do something a bit more complex, you may want to check the rest of the editors in this list.

Installation of Avidemux

Avidemux is available for install from the Ubuntu software center and it can also be installed via:

$ sudo apt-get install avidemux

Avidemux Video Editor

Avidemux Video Editor

For other Linux distributions, you need to compile it from source using source binary packages available from Avidemux download page.

4. Blender

Blender is an advanced open source video editing software, that has many useful features, which is why it might be a preferred choice from people who are looking for a more professional video editing solution.

Here are some of the features in question:

  1. 3D modeling
  2. Grid and bridge fill
  3. N-Gon support
  4. Physically accurate shaders
  5. Open Shading Language for developing custom shaders
  6. Automatic skinning
  7. Animation toolset
  8. Sculpting
  9. Fast UV Unwrapping

Installation of Blender

Blender is available for download via the Ubuntu software manager or installed via:

$ sudo apt-get install blender

Blender Video Editor

Blender Video Editor

Download source binary packages for other Linux distributions from Blender download page.

5. Cinelerra

Cinelerra is a video editor that was released in 2002 and has millions of downloads ever since. It’s designed to be used from both beginners and advanced users. According to developer’s page, CineLerra is designed from artists for artists.

Some of the main features of Cinelerra are:

  1. UI designed for professionals
  2. Build in frame-renderer
  3. Dual-Link
  4. Deck control
  5. CMX compliant EDL functionality
  6. Different effects
  7. Audio editing with unlimited amount of layers
  8. Render farm that renders and transcodes compressed and uncompressed frames

Installation of Cinelerra

For installation of Cinerella, use the instructions provided at official Cineralla installation instructions.

Cinerella Video Editor

Cinerella Video Editor

6. KDEnlive

Kdenlive is another open source video editing software. It relies on few other projects such as FFmpeg and MLT video framework. It is designed to cover basic needs to semi-professional tasks.

With Kdenlive you receive the following features:

  1. Mix video, audio and image formats
  2. Create custom profiles
  3. Support for wide range of comcorders
  4. Multitrack edition with a timeline
  5. Tools to crop, edit, move and delete video clips
  6. Configurable keyboard shortcuts
  7. Different effects
  8. Option to export to standard formats

Installation of Kdenlive

Kdenlive is available for download from the Ubuntu software center or alternately you can install by typing the following commands in a terminal:

$ sudo add-apt-repository ppa:sunab/kdenlive-release 
$ sudo apt-get update 
$ sudo apt-get install kdenlive

If you want to install it for Fedora/RHEL based operating systems, you can download the require page from Kdenlive download page.

Kdenlive Video Editor

Kdenlive Video Editor

7. Lightworks

Lightworks is a professional video editing tool designed for everyone. It has a free and paid version, both of which are quite feature rich. It’s multi-platform and can be used on Linux, Windows and Mac. It has plenty of features that you can use.

We will mention some of the highlights, but keep in mind that there are much more:

  1. Vimeo export
  2. Wide container support
  3. Import and export functions (batches supported as well)
  4. Transcode on import
  5. Drag-n-drop replace editing
  6. Replace, fit to fill
  7. Advanced realtime multicam editing
  8. Frame accurate capture tool
  9. Trimming
  10. Wide variety of effects

Installation of Lightworks

The installation of Lightworsks is completed via .deb or .rpm packages that can be downloaded from Lightworks for Linux page.

Lightworks Video Editor

Lightworks Video Editor

8. LiVES

LiVES is a video editing system designed to me powerful and yet simple for use. It can be used across multiple platforms and it is expendable via RFX plugins. You can even write your own plugins in Perl, C or C++ or python. Other languages are supported as well.

Here are some of the main features LiVES:

  1. Loading and editing of almost every video format via mplayer
  2. Smooth playback at variable rates
  3. Frame accurate cutting
  4. Saving and re-encoding of clips
  5. Lossless backup and restore
  6. Real time blending of clips
  7. Supports fixed and variable frame rates
  8. Multiple effects
  9. Customizable effects and transitions
  10. Dynamic loading of effects

Installation of LiVES

LiVES is available for download for different Linux operating systems. You can download the appropriate package from LiVES download page.

LiVES Video Editor

LiVES Video Editor

Conclusion

As you saw above, video editing in Linux is now a fact and even though not all Adobe products are supported in Linux, there are very good alternatives that are ready to provide same functionality.

If you have any questions or comments related to the video editing software described in this article, please do not hesitate to submit your opinion or comment in the comment section below.

Source

Top 6 Partition Managers (CLI + GUI) for Linux

Are you looking to tweak or manage your disks partitions in Linux? In this article, we will review some of the best tools that help Linux users partition and manage their disks. We will see both command line utilities as well as GUI applications for managing disk partitions in Linux.

Read Also9 Tools to Monitor Linux Disk Partitions and Usage in Linux

I favor the command line over GUI (graphical user interface), I will start by describing the text based utilities and then GUI applications as follows.

1. Fdisk

fdisk is a powerful and popular command line tool used for creating and manipulating disk partition tables. It supports multiple partition tables formats, including MS-DOS and GPT. It provides a user-friendly, text based and menu driven interface to display, create, resize, delete, modify, copy and move partitions on disks.

Fdisk Partition Tool

Fdisk Partition Tool

2. GNU Parted

Parted is a popular command line tool for managing hard disk partitions. It supports multiple partition table formats, including MS-DOS, GPT, BSD and many more. With it, you can add, delete, shrink and extend disk partitions along with the file systems located on them.

Parted Partition Program

Parted Partition Program

It can help you create space for installing new operating systems, reorganizing disk usage, and move data to new hard disks.

3. Gparted

GParted is a free, cross platform and advanced graphical disk partition manager that works on Linux operating systems, Mac OS X and Windows.

GParted Partition Manager and Editor

GParted Partition Manager and Editor

It is used to resize, copy, move, label, check or delete partitions without data loss, enabling you to grow or shrink root partition, create space for new operating systems and attempt data rescue from lost partitions. It can be used to manipulate file systems including EXT2/3/4.

4. GNOME Disks a.k.a ( GNOME Disks Utility)

GNOME Disks is a core system utility used for disk partition management and S.M.A.R.T monitoring. It is used to format and create partition on drives, mount and unmount partitions. It ships in with the well known GNOME desktop environment.

Gnome Disks

Gnome Disks

Lately, it’s been gaining features for advanced usage. The latest version (at the time of this writing) has a new feature for adding, resizing partitions, checking filesystems for any damages and repairing them.

5. KDE Partition Manager

KDE partition manager is a useful graphical utility for managing disk devices, partitions and file systems on your computer. It comes with the KDE desktop environment.

KDE Partition Manager

KDE Partition Manager

Most of its underlying work is performed by programs. It can be used to easily create, copy, move, delete, resize without losing data, backup and restore partitions. It supports various including EXT2/3/4, BTRFS NTFS, FAT16/32, XFS, and more.

6. Qtparted

In addition, you can also use Qtparted, is a Partition Magic (proprietary software for Windows) clone and Qt front-end to GNU Parted. Note that it still in development and you may likely experience any kind of problem with latest release. In that case try to use the CVS version or a previous stable version.

QTParted Partition Magic

QTParted Partition Magic

It may not be one of the best options now but you can give it a try. More features are yet being added to it.

You might also like to read these following related articles.

  1. 4 Tools to Manage EXT2, EXT3 and EXT4 Health in Linux
  2. 3 Useful GUI and Terminal Based Linux Disk Scanning Tools
  3. Recover Deleted or Lost Files in Linux

These are the best partition managers and editors available for Linux operating systems. Which tool do you use?

Source

24 Outstanding Backup Utilities for Linux Systems in 2018

Backup on personal computers or servers is always important to prevent permanent data loss. Therefore getting to know different backup tools is very important especially for System Administrators who work with large amounts of enterprise level data and even on personal computers.

Linux Backup Tools

11 Linux Backup Tools

It is always a good practice to keep on backing up data on our computers, this can either be done manually or configured to work automatically. Many backup tools have different features that allow users to configure the the type of backup, time of backup, what to backup, logging backup activities and many more

In this article, we shall take a look at 24 outstanding backup tools that you can use on Linux servers or systems.

Honorable Mention – CloudBerry Backup

CloudBerry Backup for Linux is a cross-platform cloud backup solution with advanced backup configuration settings and providing total security of data.

CloudBerry Backup for Linux

CloudBerry Backup for Linux

With this tool you can backup files and folders to the cloud storage of your choice: it supports more than 20wide-known cloud storage services. CloudBerry Backup works with Ubuntu, Debian, Suse, Red Hat and other Linux distributions and is also compatible with Windows and Mac OSs.

The primary backup features are:

  • Compression
  • 256-bit AES Encryption
  • Scheduled backup
  • Incremental backup
  • Command line interface
  • Retention policy and more.

1. Rsync

It is a command line backup tool popular among Linux users especially System Administrators. It feature rich including incremental backups, update whole directory tree and file system, both local and remote backups, preserve file permissions, ownership, links and many more.

It also has a graphical user interface called Grsync but one advantage with the rsync is that backups can be automated using scripts and cron jobs when used by experienced System Administrators on the command line.

Rsync Backup Tool

Rsync Backup Tool

We’ve covered so many articles on rsync tool in the past, you can go through them below:

  1. 10 Useful Commands on Linux Rsync Tool
  2. Sync Two Servers Using Rsync on Non-Standard SSH Port
  3. Sync Two Apache Linux Web Servers Using Rsync Tool

2. Fwbackups

It is free and open source software which is cross platform and feature rich and users can contribute to it’s development or just participate in testing it. It has an intuitive interface that allows users to do backups easily.

It has features such as:

  1. Simple interface
  2. Flexibility in backup configuration
  3. Remote backups
  4. Backup entire file system
  5. Exclude files and directories plus many more

fwbackups for Linux

fwbackups for Linux

Visit Homepage: http://www.diffingo.com/oss/fwbackups

3. Bacula

It is open source data backup, recovery and verification software that is designed to be enterprise ready with certain complexities, though these complexities actually define it’s powerful features such as backup configurations, remote backups plus many more .

It is network based and is made up of the following programs:

  1. a director : program that supervises all operations of Bacula.
  2. a console : program that allows a user to communicate with the Bacula director above.
  3. a file: program that is installed on the machine to be backed up.
  4. storage: program that is used to read and write to your storage space.
  5. catalog: program responsible for the databases used.
  6. Monitor: program that keeps track of all events happening in different parts of Bacula.

Bacula Backup Tool for Linux

Bacula Backup Tool for Linux

Visit Homepage: http://www.bacula.org/

4. Backupninja

It is powerful backup tool that allows users to design backup activity configuration files that can be drooped in /etc/backup.d/ directory. It helps to perform secure, remote and also incremental backups over a network.

It has got the following features:

  1. Easy to read ini style configuration files.
  2. Use scripts to handle new types of backups on your system.
  3. Schedule backups
  4. Users can choose when status report emails are mailed to them.
  5. Easily create backup action configuration file with console-based wizard (ninjahelper).
  6. Works with Linux-Vservers.

BackupNinja Tool

BackupNinja Tool

Visit Homepage: https://labs.riseup.net/code/projects/backupninja

5. Simple Backup Suite (sbackup)

It is backup solution for Gnome desktop where users can access all configuration via Gnome interface. Users can use regex to specify file and directory paths during the backup process.

It has the following features:

  1. Creates compressed and uncompressed backups.
  2. Supports multiple backup profiles.
  3. Allows logging, email notifications.
  4. Scheduled backups and manual backups.
  5. Split uncompressed backups into several chunks.
  6. Supports local and remote backups.

Simple Backup sbackup Tool

Simple Backup sbackup Tool

Visit Homepage: https://sourceforge.net/projects/sbackup/

6. Kbackup

It is an an easy to use backup tool for Unix operating system and can be used on Linux. It can create archives and compress them using tar and gzip utilities respectively.

Kbackup has got the following features:

  1. User friendly and menu driven interface.
  2. Support for compression, encryption and double buffering.
  3. Automated unattended backups.
  4. High reliability.
  5. Support for full or incremental backups.
  6. Remote backup across networks.
  7. Portable and extensive documentation among others.

kBackup Tool for Linux

kBackup Tool for Linux

Visit Homepage: http://kbackup.sourceforge.net/

7. BackupPC

It is a cross platform backup software that can run on Unix/Linux, Windows and Mac OS X. It is designed to for enterprise level use with high performance measure. BackupPC can be used on servers, desktop and laptop computers.

It has some of the following features:

  1. File compression to reduce disk space usage.
  2. No need for client side software.
  3. Flexibility during backup restoration
  4. Flexibility in configuring through different parameters.
  5. User notifications about need for backups and so on.

BackupPC Server

BackupPC Server

Visit Homepage: https://backuppc.github.io/backuppc/

8. Amanda

Amanda is an open source software that works on Unix/GNU Linux and Windows. It supports native backup utilities and formats such as GNU tar for backups on Unix/Linux. And for backups on Windows machine, it uses native Windows client. Users can setup a single backup server to store backups from several machines on a network.

Visit Homepage: http://www.amanda.org/

9. Back In Time

It is simple and easy to use backup tool for Linux operating system and works by taking snapshots of specified directories and backing them up.

It has features such as configuring:

  1. Storage location to save snapshots.
  2. Manual or automatic backups.
  3. Directories to backup.

Back in Time Backup

Back in Time Backup

Visit Homepage: https://github.com/bit-team/backintime

10. Mondorescue

This is a free backup and rescue software which is reliable and all features-inclusive. It can perform backups from personal computers, work stations or servers to hard disk partitions, tapes, NFS, CD-[R|W], DVD-R[W], DVD+R[W] and many more.

It also has data rescue and recovery abilities during backup process in case of any destructive events.

Mondorescue Backup Tool for Linux

Mondorescue Backup Tool for Linux

Read More: How to Backup/Clone Linux Systems Using Mondo Rescue

11. Box Backup Tool

It is an open source backup tool and can be configured to work automatically. It has features such as:

  1. Online backups
  2. Backup daemon for automated backups
  3. Storage of backups in files
  4. Data compression and encryption
  5. Tape like behavior
  6. Choice of backup behavior plus many others

Visit Homepage: https://github.com/boxbackup/boxbackup

12. Luckybackup

It is a free powerful, quick, reliable and easy to use backup and sync tool that is powered by the rsync backup tool.

It is feature-rich with features such as:

  1. Preserve ownership and file permissions.
  2. Create multiple backup snapshots.
  3. Advanced options files and directories.
  4. Exclude options and use rsync options and many more.

LuckyBackup Tool

LuckyBackup Tool

Visit Homepage: http://luckybackup.sourceforge.net/

13. Areca

It is an open source backup tool that is intended for personal use and it allows a user to select a set of files or directories to backup and select the backup method and storage location.

It has features such as:

  1. Email notifications about backup process.
  2. Simplicity in use in terms of configurations.
  3. Browse archives and many more.

Visit Homepage: http://www.areca-backup.org/

14. Bareos Data Protection

It is an open source set of programs that allows users to backup, recover and protect data on Linux systems. It is an idea forked from the Bacula backup tool project and works on a network in a client/server architecture.

The basic functionalities are free but payment is required to use professional backup features. It has features of Bacula backup tool.

Visit Homepage: https://www.bareos.org/en/

15. BorgBackup

BorgBackup is a free open source, efficient as well as secure command-line based deduplicating archiver/backup tool with support for compression and authenticated encryption. It can be used to perform daily backups and only changes in files since last backup are archived, using the deduplicating approach.

The following are some its key features:

  • It is easy to install and use.
  • Supports encryption of all data.
  • Uses authenticated encryption technique to ensure secure backups.
  • It is also very fast.
  • Supports space efficient storage.
  • Also supports optional compression of data.
  • Supports remote backups over SSH.
  • Supports mounting backups in the same way as filesystems.

Borg Backup Tool For Linux

Borg Backup Tool For Linux

Visit Homepagehttps://borgbackup.readthedocs.io/en/stable/

16. Restic

Restic is a free open source, efficient, easy-to-use, fast and secure command-line based backup program. It is designed to secure backup data against attackers, in any kind of storage environment.

The following are its key features:

  • It is cross platform, works on Unix-like systems such as Linux, and also Windows.
  • It is easy to install, configure and use.
  • Uses encryption for securing data.
  • Only backs up changes in data.
  • Supports verifying of data in backup.

Restic Backup Tool for Linux

Restic Backup Tool for Linux

Visit Homepagehttps://restic.net/

17. rsnapshot

Rsnapshot is a free open source backup tool for Unix-like operating systems, based on rsync. It is designed to take a filesystem snapshot on local machines, as well as remote hosts over SSH. Rsnapshot supports periodic snapshots and users can automate backups via cron jobs. In addition, it is also efficient in managing disk space used for backups.

Read Morehttps://www.tecmint.com/rsnapshot-a-file-system-backup-utility-for-linux/

18. Burp

Burp is a free open source, efficient, feature-rich and secure backup and restore software. It is designed to work over a network in a client/server architecture (server mode works on Unix-based systems such as Linux, and clients run on Unix-based and Windows systems), and in that case aims to minimize network traffic for reliable results.

Below are the its key features:

  • Supports two independent backup protocols: protocol I and II; each with different features.
  • Supports network backups.
  • Supports resuming of interrupted backups.
  • Supports backing up and restoring files, directories, symlinks, hardlinks, fifos, nodes, permissions as well as timestamps.
  • Also supports scheduling of backups.
  • Supports email notifications about successful or failed backups.
  • Offers a live ncurses monitor on the server.
  • Supports storage data deduplication like many other backup tools.
  • Supports compression of data on a network and in storage.
  • Supports auto signing of SSL certificate authority and client certificate, and many others.

Visit Homepagehttps://burp.grke.org/

19. TimeShift

Timeshift is a backup and restore tool for Linux systems which takes incremental snapshots of filesystem at regular intervals. It works in a similar way as rsnapshot (since it uses rsync and hard-links to create snapshots), but offers certain unique features that are not present in its counterpart. Additionally, it is designed to only backup system files and settings.

The following are key features of Timeshift:

  • Only takes snapshot of system file and settings, user data such as pictures, music, etc are not archived.
  • Takes filesystem snapshots using rsync+hardlinks, or BTRFS snapshots.
  • Supports scheduled snapshots.
  • Supports multiple backup levels with excluding filters.
  • Allows for restoring of snapshots during system runtime or from live devices(such as USB).

Timeshift System Restore Tool for Linux

Timeshift System Restore Tool for Linux

Visit Github Repositoryhttps://github.com/teejee2008/timeshift

20. Duplicity

Duplicity is a free open source, secure and bandwidth-efficient backup tool based on rsync. It creates encrypted backups of directories in tar-format archives and backs them on the local or remote machine over SSH. When launched for the first time, performs a full backup, and in subsequent backups in the future, it only records parts of files that have changed.

Below are ducplicity’s key features:

  • It’s easy-to-use and employs a standard file format.
  • It only tracks and considers changes in files since the last backup.
  • It creates incremental archives that are space efficient.
  • Creates encrypted and/or signed archives for security purposes.
  • Supports signatures and deltas of directories and regular files in tar-format.

Read MoreCreate Encrypted and Bandwidth-efficient Backups Using Duplicity

21. Déjà Dup

Déjà Dup is a simple, secure and easy-to-use backup tool for Linux systems built for encrypted, off-site, and regular backups. It allows for local, remote, or cloud backup storage with services such as Google Drive and Nextcloud.

Deja Dup Backup

Deja Dup Backup

Below are Déjà Dup key features:

  1. Uses duplicity as the backend.
  2. Supports encryption and compression of data.
  3. Supports incremental backs up, allowing you to restore from any particular backup.
  4. Supports scheduling of regular backups.
  5. You can easily integrates it into GNOME desktop environment.

22. UrBackup

UrBackup is an open source easy to setup client/server backup system for Linux, Windows and Mac OS X, that through a mixture of image and file backups carry out both data security and a speedy restoration time.

UrBackup Tool for Linux

UrBackup Tool for Linux

Below are UrBackup key features:

  1. Secure and effieicnt complete and incremental image and file backups via network.
  2. A web interface that displays the status of the clients, current activities and statistics.
  3. Backups reports send to users or administrators.
  4. Easy to use file and image restore using CD/USB drive.
  5. Easy to configure and use file backup access.
  6. E-Mail notifications if a client machine is not backed up for a given amount of time.

23. rclone

Rclone is a powerful command line program written in Go language, used to sync files and directories from multiple cloud storage providers such as: Amazon Drive, Amazon S3, Backblaze B2, Box, Ceph, DigitalOcean Spaces, Dropbox, FTP, Google Cloud Storage, Google Drive, etc.

rclone Sync Data

rclone Sync Data

Summary

Always remember that backup is very important and helps prevent data loss and you can use various backup tools for Linux to carry out regular backup of your data.

You could be using a backup tool that we have not looked at, let us know of it by posting a comment and hope you find the article helpful.

Source

Pybackpack (Python Backpack) Manager tool for Ubuntu and Linux Mint

Pybackpack is an open source simple, powerful and user-friendly file backup utility was written for Gnomedesktop only and released under the GPL, but you can also use it for other desktops too. Like you do for other backup applications. The interface is pretty simple and provides a good design which makes the whole process user friendly and much easier.

The pybackpack tool uses back-end as rdiff-backup program for backups. The benefit of using rdiff-backup is, it do full backup at first time and later backups it takes only updated files. This is very crucial in terms of saving disk space and network bandwidth.

Installing Pybackpack Backup Manager

Open the terminal by hitting “Ctr + Alt + t” and run the following command to install Pybackpack backup manager tool under Ubuntu 12.10/12.04/11.10 and Linux Mint 14/13/12

$ sudo apt-get install pybackpack

Once you’ve installed it, launch it from the Desktop Dash or use the following command.

$ pybackpack

Backup /home directory to CD or DVD

Once you’ve start you will see Home tab with “Go” option, if you click on “Go” button, it will backup your entire /home directory including your personal settingsemailsdocuments and other important files and burn automatically them to a CD or DVD as a iso image file.

backup files to cd/dvd

Pybackpack Backup Files to CD/DVD

Backup /home directory on Local File System

Instead of taking full backup, you can customize your backup by choosing more advanced options by specifying what folders and files you want to include or exclude in your backup. To do this, click on “Backup” tab and then select “New Backup Set” from the drop-down list.

backup files to local

Pybackpack backup files to local

Click on “Edit” option. Now you will see a backup wizard that will guide you through the steps that required to create a set of files for backup, known as “backup set“.

Pybackpack New Backup Set

Create New Backup Set

Give name and description for the backup set and also select destination type as “Local File System” from the drop-down list. Enter the default destination directory where the actual backup will be stored. In my case it would be stored under /home/tecmint/Tecmint-Backup directory.

Plybackpack Backup Set Name

Give Backup Set Name

Now add the files and directories that needs to be included or excluded for the backup set. I have included the following files for backup. Nothing excluded, but you can exclude the files that you don’t want to backup.

  1. /home/tecmint/Desktop
  2. /home/tecmint/Documents
  3. /home/tecmint/Downloads
  4. /home/tecmint/Music
  5. /home/tecmint/Pictures

Pybackpack add files to backup

Include / Exclude Files for Backup

This gives the full summary of backup for review, if you want to make changes you can click on “Back” button. To proceed with the selection and save the backup click on “Forward“.

Pybackpack Backup Summary

Pybackpack Backup Summary

Click on “Apply” to Finish the backup wizard.

Pybackpack Apply Changes

Pybackpack Apply Changes

Finally, click on “Backup” button to create the backup, based on the settings that we have given during the backup set.

Pybackpack Backup

Create Backup

Once backup process over, you will get message as “Backup complete“.

Pybackpack Backup Completed

Pybackpack Backup Completed

To verify, whether backup is successfully completed, go to the backup directory and do “ls -l“. You will see following folders.

Verify Backup Directory

Verify Backup Directory

Are you worrying why there is “rdiff-backup-data” folder, because pybackpack uses rdiff-backup utility to keep the track of incremental backups. So, next time you run the same backup set, it will only take backup of latest and changed files. It is very effective in terms of saving system disk space and bandwidth.

Backup /home directory to Remote System

Instead of taking backups on CD/DVD or Local system, you can also take backup and keep them on remote server directly. Again create a “New Backup Set” and add the username, hostname and location of backup directory of remote host.

Pybackpack remote backup

Pybackpack remote backup

Restore /home directory from Local System

Go to “Restore” tab and select the “Local” and enter your backup destination directory. The restore option automatically detect the name and description of the backup set.

Once I entered the location of backup (i.e. /home/tecmint/Tecmint-Backup), it immediately detect the name and description of the backup set as “Tecmint Home Backup“.

Pybackpack Restore Local

Pybackpack Restore Local

Don’t worry the restore will not overwrite the files and folders, it will create a new folder called “restored_files” under /home directory and restore all files under this directory. For example In my case it would be “/home/tecmint/restored_files/Tecmint Home Backup“.

Restore /home directory from Remote System

Go to “Restore” tab and select the “Remote (SSH)” and enter remote host details like username and hostname/ip address. Give the location of backup directory and click on “Restore” button.

Pybackpack Remote Restore

Pybackpack Remote Restore

Thats it! If you have any questions or queries do reply me using comment section.

Source

CloudBerry Backup for Linux: Review and Installation

When it comes to backups, experience says it’s better to be safe than sorry. Better to have much than not enough – you get the point. In this article, we will present CloudBerry Backup for Linux, a cross-platform cloud backup and disaster recovery software.

As a leading solution in the industry, CloudBerry stands out for its flexibility, reliability, and its wide set of out-of-the-box features. You not only get to choose where to store your data (locally or using a cloud storage service), but also can encrypt it using AES-128 or AES-256.

With the recent release of version 2.5.1, which introduces support for block-level backups, this tool stands out among its crowd of competitors more than ever. This new feature is particularly important if you need to back up large files with relatively minor changes over time.

With both a GUI and a command-line interface, optional compression to save up on bandwidth and decrease storage costs, and no hidden fees for data restore, CloudBerry is hard to beat!

And this is just the top of the iceberg. Believe me – creating, managing, and restoring backups has never been easier, not even in the cloud computing era. Keep reading to find out more!

Installing CloudBerry Backup for Linux

Although CloudBerry is a commercial product, it provides a full-featured trial version that you can use to test-drive the solution. Additionally, a freeware version for personal use (which provides most of the functionality of the Pro edition, except for data encryption) is also available.

Regardless of the version, licenses are one-time off (pay once, get a perpetual license) with an optional yearly maintenance fee that includes support and free upgrades during that period of time.

First, go the download section of Linux cloud backup and click Download. In the next page, choose the link that corresponds to your distribution.

In this article, we will be installing the solution on a CentOS 7 machine. The installation on other distributions is almost identical, so you should not run into any issues if you stick to this tutorial.

To begin, let’s click on the link for CentOS 6/7 and wait for the download to complete:

Download CloudBerry Backup for Linux

Download CloudBerry Backup for Linux

Once done, follow these steps to proceed with the installation of CloudBerry Backup for Linux:

1. Browse to the folder where the binary file was downloaded and double click on it. The following window will pop up. Click Install to continue.

Cloudberry Installation

Cloudberry Installation

When the installation is complete, Install will change to Remove, as you can see in the below image:

CloudBerry Installation Complete

CloudBerry Installation Complete

2. Open a terminal and enter the following commands to request the trial version. Note the pair of single quotes surrounding CloudBerry Backup:

# cd /opt/local/'CloudBerry Backup'/bin

Next, do

./cbb activateLicense -e "YourEmailHere@YourDomain.com " -t "ultimate"

If the above command returns Success, the trial version is ready to use. To launch it, go to the Internet section in your Applications and click CloudBerry Backup. Next, click Continue Trial and Finish to proceed:

CloudBerry Backup Trial Version

CloudBerry Backup Trial Version

Create a Backup Plan and Choose a Storage Provider

Once we have installed the solution and activated the trial version, we will proceed to set up a backup plan.

3. Here you will be able to select where you will store your data. As you can see, CloudBerry is well integrated with all the major cloud storage service providers.

As a Bring-Your-Own-Storage (BYOS) solution, it allows you to leverage any existing cloud services you may already be using.

Select CloudBerry Backup Storage

Select CloudBerry Backup Storage

Regardless of the chosen backup plan, we are assuming that you have already setup the authentication mechanism. In our case we will go with Azure, and once we have entered a display name of our choosing, one of the access keys to our storage account, the account name, and specified a container name, let’s click OK and Continue:

CloudBerry Backup Storage Account Details

CloudBerry Backup Storage Account Details

Next, choose a name for the current backup plan:

Choose CloudBerry Backup Name

Choose CloudBerry Backup Name

Note that, by default, support for block-level backups are disabled. You can choose to enable this feature in this step by checking Use block level backup as you can see below:

CloudBerry Enable Block-Level Backup

CloudBerry Enable Block-Level Backup

When you click Continue, you will be asked to set up a periodic full backup so that the retention policy (more on this in a minute) can be applied on old versions as well.

Now choose the files and folders you want to backup:

Select CloudBerry Backup Files

Select CloudBerry Backup Files

You will then be prompted to indicate the kind of files that you want to include or exclude from your backup. You can also enable All files as well, choose whether to use compression, and the kind of encryption that you want to use:

CloudBerry Backup Compression and Encryption

CloudBerry Backup Compression and Encryption

4. Choose a Retention Policy and a backup schedule that suits your needs. This will tell CloudBerry when and how to delete old backup files. If in doubt, go with the defaults:

CloudBerry Backup Retention Policy

CloudBerry Backup Retention Policy

For the backup schedule, you can choose to run it manually, on a specific date and time, or recurrently on a given frequency. The image below shows a schedule backup that will take place every Friday at 1 pm:

Schedule Cloudberry Backup

Schedule Cloudberry Backup

If you wish, you can enable notifications at this point. Note that you can specify a list of recipients separated by semicolons, modify the subject line, and choose to be notified in all cases or only when a backup fails:

Cloudberry Backup Notifications

Cloudberry Backup Notifications

5. Run the plan now to check if it works as expected:

Cloudberry Backup Summary

Cloudberry Backup Summary

The backup plan will then be executed. Depending on the size of the chosen files and folders, it may take a few minutes (or more) to fully synchronize with the remote storage account.

And this is where the block level capability comes in handy: only the modified parts of your files will be uploaded during subsequent backups – allowing you to save up on bandwidth and time!

When the process is complete, a green checkmark will appear next to the backup plan in CloudBerry. Now let’s check our Azure container to ensure that our files are already there. And voilá! It’s not magic – it’s CloudBerry Backup for Linux:

Verify Cloudberry Backup Files

Verify Cloudberry Backup Files

Testing the CloudBerry Backup Restore Functionality

So far so good – on to testing we go!

6. Remove a file from the source (thinkcspy3_latest.zip). Click Restore in the CloudBerry Backup interface and choose the plan to restore from.

Since the steps to set up a restore plan are similar to setting up a backup plan, we will not go into detail – only summarize in the following image. Each step is self-explanatory. In #6, enter the password that you chose when you created the backup plan earlier:

Cloudberry Backup Restore

Cloudberry Backup Restore

After the restore plan is completed, you should see the file that you removed back in the source. Simple as that!

Summary

In this article, we have explained how to install CloudBerry Backup for Linux, and how to create a backup plan integrated with Microsoft Azure.

Additionally, we showed how easy it is to restore files from the remote storage account back to our machine. Additionally, if you prefer to use the command line to manage backup and restore plans, you can refer to the page of CloudBerry Backup command line interface for Linux.

Easy to install, and much easier to use – totally worth your time and a few bucks to buy a license, isn’t it?

As always, don’t hesitate to let us know if you have any questions or comments about this article. The feedback of our readers is always highly appreciated.

Source

OpenStack in RHEL/CentOS 7

How to Install Your Own Cloud Platform with OpenStack in RHEL/CentOS 7

OpenStack is a free and open-source software platform which provides IAAS (infrastructure-as-a-service) for public and private clouds.

OpenStack platform consists of several inter-related projects that control hardware, storage, networking resources of a datacenter, such as: Compute, Image Service, Block Storage, Identity Service, Networking, Object Storage, Telemetry, Orchestration and Database.

The administration of those components can be managed through the web-based interface or with the help of OpenStack command line.

Install OpenStack in CentOS 7

Install OpenStack in CentOS 7 and RHEL 7

This tutorial will guide you on how you can deploy your own private cloud infrastructure with OpenStackinstalled on a single node in CentOS 7 or RHEL 7 or Fedora distributions by using rdo repositories, although the deployment can be achieved on multiple nodes.

Requirements

  1. Minimal Installation of CentOS 7
  2. Minimal Installation of RHEL 7

Step 1: Initial System Configurations

1. Before you begin preparing the node in order to deploy your own virtual cloud infrastructure, first login with root account and assure that the system is up to date.

2. Next, issue the ss -tulpn command to list all running services.

# ss -tulpn

List All Running Linux Services

List All Running Linux Services

3. Next, identify, stop, disable and remove unneeded services, mainly postfix, NetworkManager and firewalld. At the end the only daemon that would be running on your machine should be sshd.

# systemctl stop postfix firewalld NetworkManager
# systemctl disable postfix firewalld NetworkManager
# systemctl mask NetworkManager
# yum remove postfix NetworkManager NetworkManager-libnm

4. Completely disable Selinux policy on the machine by issuing the below commands. Also edit /etc/selinux/config file and set SELINUX line from enforcing to disabled as illustrated on the below screenshot.

# setenforce 0
# getenforce
# vi /etc/selinux/config

Disable SELinux

Disable SELinux

5. On the next step using the hostnamectl command to set your Linux system hostname. Replace the FQDNvariable accordingly.

# hostnamectl set-hostname cloud.centos.lan

Set Linux System Hostname

Set Linux System Hostname

6. Finally, install ntpdate command in order to synchronize time with a NTP server on your premises near your physical proximity.

# yum install ntpdate 

Step 2: Install OpenStack in CentOS and RHEL

7. OpenStack will be deployed on your Node with the help of PackStack package provided by rdo repository (RPM Distribution of OpenStack).

In order to enable rdo repositories on RHEL 7 run the below command.

# yum install https://www.rdoproject.org/repos/rdo-release.rpm 

On CentOS 7, the Extras repository includes the RPM that actives the OpenStack repository. Extras is already enabled, so you can easily install the RPM to setup the OpenStack repository:

# yum install -y centos-release-openstack-mitaka
# yum update -y

8. Now it’s time to install PackStack package. Packstack represents a utility which facilitates the deployment on multiple nodes for different components of OpenStack via SSH connections and Puppet modules.

Install Packstat package in Linux with the following command:

# yum install  openstack-packstack

9. On the next step generate an answer file for Packstack with the default configurations which will be later edited with the required parameters in order to deploy a standalone installation of Openstack (single node).

The file will be named after the current day timestamp when generated (day, month and year).

# packstack --gen-answer-file='date +"%d.%m.%y"'.conf
# ls

Generate Packstack Answer Configuration File

Generate Packstack Answer Configuration File

10. Now edit the generated answer configuration file with a text editor.

# vi 13.04.16.conf

and replace the following parameters to match the below values. In order to be safe replace the passwords fields accordingly.

CONFIG_NTP_SERVERS=0.ro.pool.ntp.org

Please consult http://www.pool.ntp.org/en/ server list in order to use a public NTP server near your physical location.

Add NTP Server in Packstack

Add NTP Server in Packstack

CONFIG_PROVISION_DEMO=n

Add Provision in Packstack

Add Provision in Packstack

CONFIG_KEYSTONE_ADMIN_PW=your_password  for Admin user

Add Admin Account in Packstack

Add Admin Account in Packstack

Access OpenStack dashboard via HTTP with SSL enabled.

CONFIG_HORIZON_SSL=y

Enable HTTPS for OpenStack

Enable HTTPS for OpenStack

The root password for MySQL server.

CONFIG_MARIADB_PW=mypassword1234

Set MySQL Root Password in OpenStack

Set MySQL Root Password in OpenStack

Setup a password for nagiosadmin user in order to access Nagios web panel.

CONFIG_NAGIOS_PW=nagios1234

Set Nagios Admin Password

Set Nagios Admin Password

11. After you finished editing save and close the file. Also, open SSH server configuration file and uncomment PermitRootLogin line by removing the front hashtag as illustrated on the below screenshot.

# vi /etc/ssh/sshd_config

Enable SSH Root Login

Enable SSH Root Login

Then restart SSH service to reflect changes.

# systemctl restart sshd

Step 3: Start Openstack Installation Using Packstack Answer File

12. Finally start Openstack installation process via the answer file edited above by running the below command syntax:

# packstack --answer-file 13.04.16.conf

Openstack Installation in CentOS

Openstack Installation in Linux

13. Once the installation of OpenStack components is successfully completed, the installer will display a few lines with the local dashboard links for OpenStack and Nagios and the required credentials already configured above in order to login on both panels.

OpenStack Installation Completed

OpenStack Installation Completed

The credentials are also stored under your home directory in keystonerc_admin file.

14. If for some reasons the installation process ends with an error regarding httpd service, open /etc/httpd/conf.d/ssl.conf file and make sure you comment the following line as illustrated below.

#Listen 443 https

Disable HTTPS SSL Port

Disable HTTPS SSL Port

Then restart Apache daemon to apply changes.

# systemctl restart httpd.service

Note: In case you still can’t browse Openstack web panel on port 443 restart the installation process from beginning with the same command issued for the initial deployment.

# packstack --answer-file /root/13.04.16.conf

Step 4: Remotely Access OpenStack Dashboard

15. In order to access OpenStack web panel from a remote host in your LAN navigate to your machine IP Address or FQDN/dashboard via HTTPS protocol.

Due to the fact that you’re using a Self-Signed Certificate issued by an untrusted Certificate Authority an error should be displayed on your browser.

Accept the error and login to the dashboard with the user admin and the password set on CONFIG_KEYSTONE_ADMIN_PW parameter from answer file set above.

https://192.168.1.40/dashboard 

OpenStack Login Dashboard

OpenStack Login Dashboard

Openstack Projects

Openstack Projects

16. Alternatively, if you opted to install Nagios component for OpenStack, you can browse Nagios web panel at the following URI and login with the credentials setup in answer file.

https://192.168.1.40/nagios 

Nagios Login Dashboard

Nagios Login Dashboard

Nagios Linux Monitoring Interface

Nagios Linux Monitoring Interface

That’s all! Now you can start setup your own internal cloud environment. Now follow the next tutorial that will explain how to link the server physical NIC to openstack bridge interface and manage Openstack from web panel.

How to Configure OpenStack Network to Enable Access to OpenStack Instances

This tutorial will guide you on how you can configure OpenStack networking service in order to allow access from external networks to OpenStack instances.

Requirements

  1. Install OpenStack in RHEL and CentOS 7

Step 1: Modify Network Interface Configuration Files

1. Before starting to create OpenStack networks from dashboard, first we need to create an OVS bridge and modify our physical network interface to bind as a port to OVS bridge.

Thus, login to your server terminal, navigate to network interfaces directory scripts and use the physical interface as an excerpt to setup OVS bridge interface by issuing the following commands:

# cd /etc/sysconfig/network-scripts/
# ls  
# cp ifcfg-eno16777736 ifcfg-br-ex

Setup OVS Bridge Interface in OpenStack

Setup OVS Bridge Interface in OpenStack

2. Next, edit and modify the bridge interface (br-ex) using a text editor as illustrated below:

# vi ifcfg-br-ex

Interface br-ex excerpt:

TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="no"
IPV6_AUTOCONF="no"
IPV6_DEFROUTE="no"
IPV6_FAILURE_FATAL="no"
NAME="br-ex"
UUID="1d239840-7e15-43d5-a7d8-d1af2740f6ef"
DEVICE="br-ex"
ONBOOT="yes"
IPADDR="192.168.1.41"
PREFIX="24"
GATEWAY="192.168.1.1"
DNS1="127.0.0.1"
DNS2="192.168.1.1"
DNS3="8.8.8.8"
IPV6_PEERDNS="no"
IPV6_PEERROUTES="no"
IPV6_PRIVACY="no"

Configure Bridge Network Interface for OpenStack

Configure Bridge Network Interface for OpenStack

3. Do the same with the physical interface (eno16777736), but make sure it looks like this:

# vi ifcfg-eno16777736

Interface eno16777736 excerpt:

TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="no"
IPV6_AUTOCONF="no"
IPV6_DEFROUTE="no"
IPV6_FAILURE_FATAL="no"
NAME="eno16777736"
DEVICE="eno16777736"
ONBOOT="yes"
TYPE=”OVSPort”
DEVICETYPE=”ovs”
OVS_BRIDGE=”br-ex”

Configure Physical Network Interface for OpenStack

Configure Physical Network Interface for OpenStack

Important: While editing interfaces cards make sure you replace the physical interface name, IPs and DNS servers accordingly.

4. Finally, after you’ve modified edited both network interfaces, restart network daemon to reflect changes and verify the new configurations using ip command.

# systemctl restart network.service
# ip a

Verify Network Configuration

Verify Network Configuration

Step 2: Create a New OpenStack Project (Tenant)

5. On this step we need to use Openstack dashboard in order to further configure our cloud environment.

Login to Openstack web panel (dashboard) with admin credentials and go to Identity -> Projects -> Create Project and create a new project as illustrated below.

Create New OpenStack Project

Create New OpenStack Project

Add OpenStack New Project Details

Add OpenStack New Project Details

6. Next, navigate to Identity -> Users -> Create User and create a new user by filling all the fields with the required information.

Assure that this new user has the Role assigned as a _member_ of the newly created tenant (project).

Create New User in OpenStack Project

Create New User in OpenStack Project

Step 3: Configure OpenStack Network

7. After the user has been created, log out admin from dashboard and log in with the new user in order to create two networks (internal network and external).

Navigate to Project -> Networks -> Create Network and setup the internal network as follows:

Network Name: internal
Admin State: UP
Create Subnet: checked

Subnet Name: internal-tecmint
Network Address: 192.168.254.0/24
IP Version: IPv4
Gateway IP: 192.168.254.1

DHCP: Enable

Use the below screenshots as a guide. Also, replace the Network NameSubnet Name and IP addresses with your own custom settings.

Login as User to OpenStack Dashboard

Login as User to OpenStack Dashboard

Create Network for OpenStack

Create Network for OpenStack

Create Network Subnet for OpenStack

Create Network Subnet for OpenStack

Enable DHCP for OpenStack

Enable DHCP for OpenStack

8. Next, use the same steps as above to create the external network. Make sure the IP address space for external network is in the same network range as your uplink bridge interface IP address range in order to work properly without extra routes.

Therefore, if the br-ex interface has 192.168.1.1 as a default gateway for 192.168.1.0/24 network, the same network and gateway IPs should be configured for external network too.

Network Name: external
Admin State: UP
Create Subnet: checked

Subnet Name: external-tecmint
Network Address: 192.168.1.0/24
IP Version: IPv4
Gateway IP: 192.168.1.1

DHCP: Enable

Create External Network for OpenStack

Create External Network for OpenStack

Create Subnet for External Network

Create Subnet for External Network

Enable DHCP for External Network

Enable DHCP for External Network

Again, replace the Network NameSubnet Name and IP addresses according to your own custom configurations.

9. On the next step we need to log in OpenStack dashboard as admin and mark the external network as Externalin order to be able to communicate with the bridge interface.

Thus, login with admin credentials and move to Admin -> System-> Networks, click on the external network, check the External Network box and hit on Save Changes to apply the configuration.

Login as Admin in OpenStack Dashboard

Login as Admin in OpenStack Dashboard

Select External Network

Select External Network

Make Network as External Network

Make Network as External Network

External Network Settings Updated

External Network Settings Updated

When done, logout from admin user and log in with the custom user again to proceed to the next step.

10. Finally, we need to create a router for our two networks in order to move packets back and forth. Go to Project -> Network -> Routers and hit on Create Router button. Add the following settings for the router.

Router Name: a descriptive router name
Admin State: UP
External Network: external 

Create Network Router in OpenStack

Create Network Router in OpenStack

11. Once the Router has been created you should be able to see it in the dashboard. Click on the router name, go to Interfaces tab and hit on Add Interface button and a new prompt should appear.

Select the internal subnet, leave the IP Address field blank and hit on Submit button to apply changes and after a few seconds your interface should become Active.

Add New Network Interface in OpenStack

Add New Network Interface in OpenStack

Configure Network Interface

Configure Network Interface

12. In order to verify OpenStack network settings, go to Project -> Network -> Network Topology and a network map will be presented as illustrated on the below screenshot.

Verify OpenStack Network Topology

Verify OpenStack Network Topology

That’s all! Your OpenStack network is now functional and ready for virtual machines traffic. On the next topic we’ll discuss how to create and launch an OpenStack image instance.

How to Create, Deploy and Launch Virtual Machines in OpenStack

In this guide we will learn how to create images and launch an instance of an image (virtual machine) in OpenStack and how to gain control over an instance via SSH.

Requirements

  1. Install OpenStack in RHEL and CentOS 7
  2. Configure OpenStack Networking Service

Step 1: Allocate Floating IP to OpenStack

1. Before you deploy an OpenStack image, first you need to assure that all pieces are in place and we’ll start by allocating floating IP.

Floating IP allows external access from outside networks or internet to an Openstack virtual machine. In order to create floating IPs for your project, login with your user credentials and go to Project -> Compute -> Access & Security -> Floating IPs tab and click on Allocate IP to The Project.

Choose external Pool and hit on Allocate IP button and the IP address should appear in dashboard. It’s a good idea to allocate a Floating IP for each instance you run.

Allocate Floating IP to Project in OpenStack

Allocate Floating IP to Project in OpenStack

Allocate Floating IP to External Pool

Allocate Floating IP to External Pool

Confirmation of Adding Floating IP

Confirmation of Adding Floating IP

Step 2: Create an OpenStack Image

2. OpenStack images are just virtual machines already created by third-parties. You can create your own customized images on your machine by installing an Linux OS in a virtual machine using a virtualization tool, such as KVMVirtualBoxVMware or Hyper-V.

Once you have installed the OS, just convert the file to raw and upload it to your OpenStack cloud infrastructure.

To deploy official images provided by major Linux distributions use the following links to download the latest packaged images:

  1. CentOS 7 – http://cloud.centos.org/centos/7/images/
  2. CentOS 6 – http://cloud.centos.org/centos/6/images/
  3. Fedora 23 – https://download.fedoraproject.org/pub/fedora/linux/releases/23/Cloud/
  4. Ubuntu – http://cloud-images.ubuntu.com/
  5. Debian – http://cdimage.debian.org/cdimage/openstack/current/
  6. Windows Server 2012 R2 – https://cloudbase.it/windows-cloud-images/#download

Official images additionally contain the cloud-init package which is responsible with SSH key pair and user data injection.

On this guide we’ll deploy a test image, for demonstration purposes, based on a lightweight Cirros cloud image which can be obtained by visiting the following link http://download.cirros-cloud.net/0.3.4/.

The image file can be used directly from the HTTP link or downloaded locally on your machine and uploaded to OpenStack cloud.

To create an image, go OpenStack web panel and navigate to Project -> Compute -> Images and hit on Create Image button. On the image prompt use the following settings and hit on Create Image when done.

Name: tecmint-test
Description: Cirros test image
Image Source: Image Location  #Use Image File if you’ve downloaded the file locally on your hard disk
Image Location: http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img 
Format: QCOWW2 – QEMU Emulator
Architecture: leave blank
Minimum Disk: leave blank
Minimum RAM: leave blank
Image Location: checked
Public: unchecked
Protected: unchecked

Create Images in OpenStack

Create Images in OpenStack

Add OpenStack Image Details

Add OpenStack Image Details

OpenStack Images

OpenStack Images

Step 3: Launch an Image Instance in OpenStack

3. Once you’ve created an image you’re good to go. Now you can run the virtual machine based on the image created earlier in your cloud environment.

Move to Project -> Instances and hit on Launch Instance button and a new window will appear.

Launch Image Instance in Openstack

Launch Image Instance in Openstack

4. On the first screen add a name for your instance, leave the Availability Zone to nova, use one instance count and hit on Next button to continue.

Choose a descriptive Instance Name for your instance because this name will be used to form the virtual machine hostname.

Add Hostname to OpenStack Instance

Add Hostname to OpenStack Instance

5. Next, select Image as a Boot Source, add the Cirros test image created earlier by hitting the + button and hit Next to proceed further.

Select-OpenStack Instance Boot Source

Select OpenStack Instance Boot Source

Add Cirros Text Image

Add Cirros Text Image

6. Allocate the virtual machine resources by adding a flavor best suited for your needs and click on Next to move on.

Add Resources to OpenStack Instance

Add Resources to OpenStack Instance

7. Finally, add one of the OpenStack available networks to your instance using the + button and hit on Launch Instance to start the virtual machine.

Add Network to OpenStack Instance

Add Network to OpenStack Instance

8. Once the instance has been started, hit on the right arrow from Create Snapshot menu button and choose Associate Floating IP.

Select one of the floating IP created earlier and hit on Associate button in order to make the instance reachable from your internal LAN.

Add Associate Floating IP to OpenStack Instance

Add Associate Floating IP to OpenStack Instance

Manage Floating IP Associations

Manage Floating IP Associations

9. To test the network connectivity for your active virtual machine issue a ping command against the instance floating IP address from a remote computer in your LAN.

Check Network of Virtual Machine in OpenStack

Check Network of Virtual Machine in OpenStack

10. In case there’s no issue with your instance and the ping command succeeds you can remotely login via SSH on your instance.

Use the instance View Log utility to obtain Cirros default credentials as illustrated on the below screenshots.

Instance View Log Utility

Instance View Log Utility

Instance Login Credentials

Instance Login Credentials

11. By default, no DNS name servers will be allocated from the internal network DHCP server for your virtual machine. This problem leads to domain connectivity issues from instance counterpart.

To solve this issue, first stop the instance and go to Project -> Network -> Networks and edit the proper subnet by hitting the Subnet Details button.

Add the required DNS name servers, save the configuration, start and connect to the instance console to test if the new configuration has been applied by pinging a domain name. Use the following screenshots as a guide.

Shutdown Instance

Shutdown Instance

Modify Instance Network Subnet

Modify Instance Network Subnet

Add DNS Servers to Instance

Add DNS Servers to Instance

Check Instance Network Connectivity

Check Instance Network Connectivity

In case you have limited physical resources in your infrastructure and some of your instances refuse to start, edit the following line from nova configuration file and restart the machine in order to apply changes.

# vi /etc/nova/nova.conf

Change the following line to look like this:

ram_allocation_ratio=3.0

Configure Physical Resources in Nova Configuration

Configure Physical Resources in Nova Configuration

That’s all! Although this series of guides just scratched the surface of OpenStack mammoth, now you have the basic knowledge to start create new tenants and use real Linux OS images in order to deploy virtual machines in your own OpenStack cloud infrastructure.

Source

WP2Social Auto Publish Powered By : XYZScripts.com