If you use the rsync utility to keep your backups synchronized between your servers or with a local machine, you might want to prevent the script from using too much bandwidth. However, rsync makes a lot of network I/O. The point of limiting bandwidth is to make sure your backup scripts don’t clog up the network connection. Naturally, limiting the amount of bandwidth your backups are using is going to make them happen more slowly, but if you can deal with that, this is the way to do … [Read more...] about How to Limit/throttle rsync transfer speed in Linux
Archives for May 2020
How to prevent SSH connections from disconnecting due to inactivity when using MobaXterm
Question: How to prevent SSH connections from disconnecting due to inactivity when using MobaXterm client? In most production environment setups, SSH connections are configured to get disconnect after a short period of inactivity. This can sometimes be frustrating as you may have to keep on logging in frequently. Well, you can try the workaround outlined below. Change SSH connection settings in MobaXterm: 1. Go to the Settings menu: 2. Select Configuration: 3. In the popup … [Read more...] about How to prevent SSH connections from disconnecting due to inactivity when using MobaXterm
MySQL – How to Backup User Privileges as CREATE USER and/or GRANT Statements
Question: How to backup the users and their privileges as CREATE USER and/or GRANT statements? The method you can use depends on the version of MySQL you are using. MySQL 5.7 and Later In MySQL 5.7 and later, the recommended way to backup the users is to use mysqlpump. This has built-in support for backing up the users and their privileges through the --users option: $ mysqlpump --exclude-databases=% --users Note: You may need to add connection parameters such as --socket, --host, … [Read more...] about MySQL – How to Backup User Privileges as CREATE USER and/or GRANT Statements
How to Set CPU Affinity for SYSTEMD Process in CentOS/RHEL 7
CPUAffinity is one of the directives to control the CPU affinity of the systemd executed processes. from the man page of systemd.exec: # man systemd.exec CPUAffinity= Controls the CPU affinity of the executed processes. Takes a list of CPU indices or ranges separated by either whitespace or commas. CPU ranges are specified by the lower and upper CPU indices separated by a dash. This option may be specified more than once in which case the specified CPU affinity masks are merged. If … [Read more...] about How to Set CPU Affinity for SYSTEMD Process in CentOS/RHEL 7
How to verify if NX/XD is Enabled or Disabled in CentOS/RHEL 7 and 8
NX stands for No eXecute and XD stand for eXecute Disable is a technology used in processors to prevent the execution of certain types of code. NX/XD is a hardware cpu feature which is provided in almost all the hardware. Some BIOS has an advanced option of enabling or disabling it. This post will help to check NX/XD the feature is enabled or disabled. Use the following command to check the status of NX/XD from the OS level. For example: 1. From dmesg command: # dmesg | grep "Execute … [Read more...] about How to verify if NX/XD is Enabled or Disabled in CentOS/RHEL 7 and 8
How to Set Environment Variables for a systemd Service in CentOS/RHEL 7
Question: How to do set environment variables for use with a systemd service of MySQL Server? There are a number of different methods that can be used to set environment variables for a systemd service. The method used can vary depending on the Linux distribution and the version of the distribution. The MySQL manual states the service setup is done simply as (example only): [Service] LimitNOFILE=max_open_files PIDFile=/path/to/pid/file Nice=nice_level LimitCore=core_file_limit Method … [Read more...] about How to Set Environment Variables for a systemd Service in CentOS/RHEL 7
How to Set Resource Limits for a Process with Systemd in CentOS/RHEL 7 and 8
Some specific applications or processes may need higher resource values than the default systemd assigned values. It's possible to override the default resource limits assigned by systemd. Basically systemd sets the default limits for any process when it starts. For example: # cat /proc/1696/limits | grep "Max locked memory" Max locked memory 65536 65536 bytes From the above example, the Max Locked memory is 64K for the PID 1696, and for some process … [Read more...] about How to Set Resource Limits for a Process with Systemd in CentOS/RHEL 7 and 8
How to add a Custom Script to systemd in CentOS/RHEL 7
The systemd facility replaces the older System-V initialization scripts from earlier releases. The systemd is an event-driven facility which allows non-dependent subsystems to be started, controlled, or stopped in parallel. Here we explain how to add a custom script to the systemd facility. 1. Write And Debug The Custom Script Typically a systemd script is written as a shell script. Begin by writing your custom script using the normal conventions. We will call our script my-custom-script.sh … [Read more...] about How to add a Custom Script to systemd in CentOS/RHEL 7
How to Disable user list on GNOME login screen in CentOS/RHEL 8
Question: How to disable the user list being shown when logging into a CentOS/RHEL 8 system? There are 2 ways to disable the user list being shown on the login screen in CentOS/RHEL 8. Per user Settings Globally Settings for all users Method 1 - Per User Setting In this method, an individual user is removed from the user list which appears on the login screen. So if we disable the user "sandy", it will not appear in the user list while other users will still be there on the … [Read more...] about How to Disable user list on GNOME login screen in CentOS/RHEL 8
How to Configure GNOME Console Login Banner in CentOS/RHEL 7 and 8
Question: How to set the banner shown as part of a console in CentOS/RHEL 8? GNOME console banner is a screen with a certain message that is shown before any user logins into the system using his/her login credentials. Login is performed by the Gnome Display Manager (GDM) tool. The steps to configure the GNOME login screen banner are outlined below. All steps are performed as the root user. 1. Create the GDM profile (if it doesn't exist) in /etc/dconf/profile/gdm which contains the … [Read more...] about How to Configure GNOME Console Login Banner in CentOS/RHEL 7 and 8