Wednesday, October 30, 2024

Rsnapshot: A Powerful Backup Tool Based on Rsync

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

Rsnapshot is an open-source local/remote filesystem backup utility written in Perl, which leverages the power of Rsync and SSH to create scheduled incremental backups of Linux/Unix filesystems.

Rsnapshot only takes up the space of a single full backup plus the differences, allowing you to store backups on a local drive, external USB stick, NFS-mounted drive, or over the network to another machine via SSH.

In this article, we’ll walk you through the process of installing, setting up, and using Rsnapshot to create hourly, daily, weekly, and monthly local backups, as well as remote backups.

Installing Rsnapshot Backup in Linux

First, you need to install and enable the EPEL (Extra Packages for Enterprise Linux) repository, as Rsnapshot is not included by default in RHEL-based distributions.

sudo dnf install epel-release
sudo dnf install rsnapshot

On Ubuntu-based distributions, rsnapshot is available in the default repositories, so you can install it using the apt package manager:

sudo apt install rsnapshot

Once installed, you can verify the installation by checking the version.

rsnapshot -v

Setting Up SSH Passwordless Login

To back up remote Linux servers, you need to configure SSH for passwordless login between the backup server and the remote machine.

Generate SSH public/private key pairs by following these commands:

ssh-keygen -t rsa

Next, copy the public key to the remote server:

ssh-copy-id user@remote-server

Configuring Rsnapshot in Linux

The configuration file for rsnapshot is located in /etc/rsnapshot.conf, open this configuration file with a text editor like nano or vim:

sudo nano /etc/rsnapshot.conf
OR
sudo vi /etc/rsnapshot.conf

Some of the important settings you’ll need to configure include:

Snapshot Backup Directory

To set the directory where your backups will be stored, you need to edit the snapshot_root line in the configuration file.

snapshot_root   /data/backup/

Set Backup Intervals

Rsnapshot supports multiple backup intervals like daily, weekly, and monthly. You can set how often you want your backups by uncommenting the following lines:

interval    hourly    6
interval    daily     7
interval    weekly    4
interval    monthly   3

Set Backup Directories

To back up local directories, add the directory paths.

backup    /home/     localhost/
backup    /etc/      localhost/

For remote backups, specify the remote server and directory to back up, like so:

backup    root@remote-server:/home/     /data/backup/

Enable Remote Backups

To enable remote backups over SSH, uncomment the cmd_ssh line:

cmd_ssh    /usr/bin/ssh

If you have changed the default SSH port, update the ssh_args line to reflect the custom port (e.g., port 7851):

ssh_args    -p 7851

Exclude Files and Directories

You can exclude certain files and directories from being backed up by creating an exclude file.

sudo nano /data/backup/exclude.txt

Add exclusions in the following format:

- /var/cache
- /tmp
+ /etc
+ /home

In your rsnapshot.conf file, reference the exclude file:

exclude_file    /data/backup/exclude.txt

After configuring Rsnapshot, verify that your setup is correct by running:

sudo rsnapshot configtest

You should see the message “Syntax OK“. If there are any errors, fix them before proceeding.

Finally, you can run Rsnapshot manually using the command for the interval you want to back up:

sudo rsnapshot hourly

Automating Rsnapshot with Cron

To automate the backup process, configure cron jobs to run Rsnapshot at specific intervals by adding the following to your /etc/cron.d/rsnapshot file:

0 */4 * * *    root    /usr/bin/rsnapshot hourly
30 3 * * *     root    /usr/bin/rsnapshot daily
0 3 * * 1      root    /usr/bin/rsnapshot weekly
30 2 1 * *     root    /usr/bin/rsnapshot monthly

Setting Up Rsnapshot Reports

Rsnapshot includes a script to send backup reports via email. To set it up, copy the script and make it executable:

sudo cp /usr/share/doc/rsnapshot/utils/rsnapreport.pl /usr/local/bin/
sudo chmod +x /usr/local/bin/rsnapreport.pl

Now, edit your rsnapshot.conf file and add the --stats flag to the rsync_long_args section:

rsync_long_args --stats --delete --numeric-ids --delete-excluded

Then, add the report to your cron job to email the report:

0 */4 * * * root /usr/bin/rsnapshot hourly 2>&1 | /usr/local/bin/rsnapreport.pl | mail -s "Hourly Backup Report" you@example.com

Monitoring Rsnapshot Backups

You can monitor your backups by checking the log files. By default, Rsnapshot logs backup activities in /var/log/rsnapshot.log.

cat /var/log/rsnapshot.log
Conclusion

Rsnapshot is an excellent choice for managing backups on Linux systems. With its efficient use of rsync, you can easily back up your files locally and remotely.

Tuesday, October 29, 2024

https://www.rosehosting.com/blog/fstab-options

Fstab options: What are they, and when should you use them?

Fstab Options

What is fstab in Lunix? What are fstab options, and when should you use them? Our latest tutorial covers all the fstab details and everything you need to know about this file. Let’s get straight into it.

Table of Contents

What is fstab?

Fstab stands for files system table and is a system file found in the /etc directory on the Linux server. The fstab file lists the available disk partitions and other disk-related file systems.

The mount command reads it and automatically mounts most entries during system boot. A set of rules in the fstab command controls how the system treats different filesystems each time it introduces them. The system administrators handle the maintenance of the fstab command.

The structure of the fstab command

Fstab stands for files system table. The six-column structure of that table requires setting up parameters in each column in the correct order. We will explain the columns separately, and important to know is that they are as follows from left to right:

[Device] [Mount Point] [File System Type] [Options] [Dump] [Pass]

Let’s explain all these in more detail:

Device: The UUID of the mounted device. (sda, sdb, etc.)

Mount Point: Your root file system mounts the device on this directory. The names of the mount points must not have spaces between them.

File System Type: Type of file system. It can be vfat, ntfs, ext4, ext3, etc.

Options: Options depend on the file system. It lists any active mount options. If there are multiple options, they must be separated by commas.

Dump (Backup Operation): The backup operation can have two values, 0 OR 1. If the value is 0, then there is no backup. It is disabled. Otherwise, if it is 1, then the backup of the partition is enabled. System administrators set this field to 0, as it uses an obsolete method they should avoid.

Pass (File System Check Order): The file system check determines the partition checking order during system boot. If the value is 0, then the fsck (file system check) will not check the filesystem. If the value is higher than 0 and is 1, then the order check should be set for the root filesystem. The other partitions should be set with 2, etc.

The usage of the fstab command

System administrators use the fstab for internal devices, CD/DVD drives, and network shares. Additionally, system administrators can add removable devices to fstab. System administrators configure partitions listed in fstab to mount automatically during boot. Only root users can see and mount partitions not listed in fstab. As we already explained the structure of the fstab command, we will now look at the content of the /etc/fstab file. To do that, execute the following command:

cat /etc/fstab

You should get an output similar to this:

root@host:~# cat /etc/fstab 
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# systemd generates mount units based on this file, see systemd.mount(5).
# Please run 'systemctl daemon-reload' after making changes here.
#
#                
# / was on /dev/vda1 during installation
UUID=1fa0d2dd-2039-44cf-bd49-c2c765693d9a / ext4 errors=remount-ro 0 1     1
/dev/vda2    none    swap    sw  0   0

As you can see, the fstab has the following parameters:

Device: UUID=1fa0d2dd-2039-44cf-bd49-c2c765693d9a

Mount Point: /

File System Type: ext4

Options: errors=remount-ro

Dump (Backup Operation): 0

Pass (File System Check Order): 1

Useful Commands

There are some useful commands that you can use for listing drives, mounting, and creating mount points.

1. To get a list of all UUIDs, you can use the following command:

ls -l /dev/disk/by-uuid

You will get an output similar to this:

root@host:~# ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 Aug 10 06:34 1fa0d2dd-2039-44cf-bd49-c2c765693d9a -> ../../vda1
lrwxrwxrwx 1 root root 10 Aug 10 06:34 706a6c4b-2cb1-4de0-899d-1e858ac12204 -> ../../vda2

2. To list the drivers and relevant attached partitions, you can use the command below:

sudo fdisk -l

Giving you an output similar to the below:

root@host:~# fdisk -l
Disk /dev/vda: 80 GiB, 85899345920 bytes, 167772160 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x076a3d03

Device     Boot     Start       End   Sectors  Size Id Type
/dev/vda1  *         2048 165675008 165672961   79G 83 Linux
/dev/vda2       165675009 167772159   2097151 1024M 82 Linux swap / Solaris

3. To mount all file systems in /etc/fstab, you can use the following command:

sudo mount -a

4. To create a new mount point, using root privileges, you can use the command below:

sudo mkdir /path/to/mountpoint

5. To check the content of the fstab, we already mentioned the command in the previous paragraph:

cat /etc/fstab

Any other fstab options?

Of course. Though these are some basic fstab options for entry-level use on a Linux OS. If you have any other suggestions or questions, drop a comment down below and we’ll try to help out as soon as we can.

If you have issues using command-line code, you can always contact our technical support. All our fully-managed plans include 24/7 support, and our admins will help you immediately.

 

 https://www.rosehosting.com/blog/best-open-source-hosting-control-panels-for-2024

Best Open Source Hosting Control Panels for 2024

Best Open Source Hosting Control Panels for 2024

What are the best open-source hosting control panels in 2024? With a slew of options to choose from, we’ll cover the most popular ones to help you reach a decision. A web hosting control panel is software for system administrators, developers, and website users alike. Their primary use lies in managing the server and software on those servers, such as websites and webmail.

Managing the server via the control panel offers many features, including

  • User account management
  • Database management
  • File management
  • Domains adding and forwarding
  • Modifying PHP settings,
  • Changing DNS settings
  • Installing SSL certificates
  • Monitoring uptime
  • …and much more

Hestia Control Panel

The Hestia Control panel is a free and open-sourced hosting control panel that is a fork of the Vesta control panel. It offers a variety of features and has become a significant competitor to premium paid control panels. Using the Hestia Control panel is cost-effective because it provides almost the same features as the paid ones, such as managing user accounts, installing SSL certificates, backups, CMS installations in one click, DNS zone management, etc.

Hestia Control panel supports Ubuntu 22.04, Ubuntu 20.04, Debian 10, 11, and 12. Installation of the Hestia CP is simple: download and execute the bash script, which may take up to 15 minutes. Once the panel is installed it can be accessed on the IP address and the port 8083 using the admin username and password displayed after completion of the installation. The Hestia Control panel is modern and easy to use, and you will not regret choosing it.

Webmin

Webmin is a free and open-sourced hosting control panel developed among the oldest control panels. It offers several features, including Support for cloud and virtualized environments, Interface customization, a File manager, Backup configuration, SSH configuration, Apache management, MySQL management, FTP management, and firewall configuration. Webmin is suitable for system administrators with more experience than beginners. It is not a beginner-friendly control panel, but the offered and free features make it one of the most used open-sourced web hosting panels.

CyberPanel

The cyber panel is a free and open-sourced hosting control panel developed and powered by OpenLiteSpeed. Its interface is modern and user-friendly and has many features for managing Users, Websites, Packages, Databases, DNS, Email, FTP, Backup, Incremental Backup, SSL, and many more. One thing that makes this control panel unique is its LiteSpeed Web server, among the Apache and Nginx. Also, this control panel is suitable for developers because it offers Docker management containerization and a staging environment for websites. One-click installations exist for the most popular applications, such as WordPress, Joomla, and Drupal. On top of all, CyberPanel offers a graphic interface for Docker application management. It is entirely free, and choosing it will make your work easier.

Ajenti

Ajent is a free, open-source hosting control panel with a fast and responsive web interface. It is built to configure and monitor services such as Apache, MySQL, Nginx, FTP, File System Management, Firewall, and many more system administrator-related tasks. Ajenti supports Debian greater than Debian 9, Ubuntu 18.04 or later, and AlmaLinux 8. The interface is similar to the Webmin interface, but the one thing that makes this control panel usable is that it has a mobile-friendly interface, and you can manage your server through your mobile device.

ISPConfig

ISPConfig, is a free and open-sourced control panel. It provides a vibrant feature set such as load balancing, clustering, user and reseller management, DNS service, and Database services, and works with Apache and Nginx from the web servers. ISPConfig is best suited for system administrators and advanced users. It has vast community support and is supported on Debian 10, Debian, 11, Debian 12, Ubuntu 18.04, Ubuntu 20.04, and Ubuntu 22.04

aaPanel

aaPanel is a free and open-sourced hosting control panel that offers the most features of the other free control panels. The features are divided in categories such as Core Functions, Website Manager, Environment, System Tools, aaPanel plugin, Storage plugin, and one-click deploy website. Let’s explain these in more detail:

Core Functions: This section is about the LAMP, LEMP stacks, Database manager, FTP Manager, Crontab manager, File System etc.

Website manager: In this section, we have Backup and restore as features, PHP management, ReverseProxy, Redirects, SSL installation, etc

Environment: This section manages phpMyAdmin, MongoDB, Memcached, Tomcat, PureFTP, Redis, PM2 manager, and many more.

System Tools: The System Tools section contains a Firewall, Logs, Supervisor, and Linux Tools.

aaPanel Plugin: The aaPanel section includes features such as One-click migration, One-Click website deployment, SSH Terminal, DNS Manager, Fail2ban, etc.

Storage plugin: This is for storage only. From storage, you are offered FTP storage, AWS S3 storage, GoogleCloud Storage, and Google Drive storage.

One-click deploy website: With one-click deploy, we can install the most popular software, such as WordPress, Laravel, Joomla, Drupal, Roundcube, etc.

Conclusion

We discussed the most used and best open-source hosting control panels in the previous paragraphs. Before you choose the right control panel, you can always find a tutorial on our blog on how to install it on your computer or virtual machine and test it. Of course, suppose you do not have experience with any Linux distro and control panels. In that case, you can always contact us, and our admins will help you with any aspect of it, like installation, configuration of your control panel, etc. You simply sign up for one of our NVMe VPS plans and submit a support ticket. We are available via live chat and tickets 24/7.

If you liked this post about the Best Open-Source Hosting Control Panels for 2024, please share it with your friends or leave a comment below.

Tags , , , , , , ,