Deleting old files in Linux helps keep your system tidy and saves space. If you have files you don’t need anymore that are older than a certain number of days, this guide will show you how to remove them step by step. It’s simple, whether you’re new to Linux or just want a quick reminder. We’ll begin with basic commands and then use them in your terminal. This article explains how to find and delete files older than a set number of days. “Older” here means the file’s last change was before that many days ago. 1. Delete Files older…
Author: Rahul
Shell scripting is an essential skill for automating tasks on Unix-like systems, enabling users to execute sequences of commands in scripts. A fundamental concept that enhances the power and efficiency of these scripts is the use of functions. This guide aims to demystify functions in shell scripting, making them accessible to beginners. What Are Functions in Shell Scripting? In shell scripting, a function is a named block of code that performs a specific task. Just like functions in traditional programming languages, shell functions allow you to encapsulate logic, making your scripts more modular, readable, and maintainable. Functions are particularly useful…
The database is the most crucial part of any application, and as a developer, ensuring the safety of your database is crucial. MySQL, a popular database management system, uses stored procedures and triggers to automate tasks and manage data efficiently. However, these valuable components are often overlooked during backup processes, potentially leading to data loss or malfunction. In this guide, we’ll walk you through the simple steps to back up and restore MySQL stored procedures and triggers. Whether you’re a beginner or an experienced developer, you’ll find this guide easy to follow and essential for maintaining your database’s integrity. Why…
If you are getting above error while restoring backup of database in postgresql. This error means you have taken backup in plain text format. Error: pg_restore: [archiver] input file does not appear to be a valid archive Solution: To restore plain text backup using below command. Backup filename: backup-db.txt Database name: mydb # cat backup-db.txt | psql mydb I hope it will help you.
CouchDB is an open source project and NoSQL, document oriented database server. It stored data with JSON documents. It also provides web interface to access documents online. Click here to read more details about CoutchDB This tutorial will help you to install Apache CouchDB server on CentOS, RedHat 7/6 servers. Step 1 – Enabel Yum Repositories First of all, use below command to install EPEL yum repository on your system. In case epel repository package not found, use this tutorial to install epel package. yum install epel-release-7-11.noarch.rpm Now create yum repository for Apache Couchdb. Create a file /etc/yum.repos.d/apache-couchdb.repo file using…
MySQL Master-Slave replication is to set up slave server to update immediately as soon as changes done in Master server. But it will not update Master if there are any changes done on slave server. Read this article to setup Master-Slave replication. This article will help you to set up Master-Master replication between MySQL servers. In this setup if any changes made on either server will update on an other one. Setup Details: Master-1: 192.168.1.15 Master-2: 192.168.1.16 Database: mydb If you are using different – different versions of MySQL on either servers use this link to check compatibility. Step 1.…
The Apache Hadoop software library is a framework that allows for the distributed processing of large data sets across clusters of computers using simple programming models. Our earlier article about hadoop was describing to how to setup single node cluster. This article will help you for step by step installing and configuring Hadoop Multi-Node Cluster on CentOS/RHEL 6. Setup Details: Hadoop Master: 192.168.1.15 ( hadoop-master ) Hadoop Slave : 192.168.1.16 ( hadoop-slave-1 ) Hadoop Slave : 192.168.1.17 ( hadoop-slave-2 ) Step 1. Install Java Before installing hadoop make sure you have java installed on all nodes of hadoop cluster systems.…
In this tutorial, you will find a simple bash script for backing up a MySQL database. The script takes a backup of the MySQL database, archives the backup, and stores it on the local system. It also removes older backups to free up space. You can specify the number of days to keep the backup on the local disk. Additionally, you can use this tutorial to back up the MySQL database and store a copy on a remote FTP server. Create MySQL Backup Script Now, copy the following content in a script file (like: /backup/mysql-backup.sh) and save on your Linux…
MySQL replication is a process where a master server replicates its data to one or more slave servers. This can provide several benefits such as increased data availability, improved performance, and easier backups. One important aspect of replication is security, and in this article, we will explore how to configure MySQL master-slave replication with authentication using SSL certificates. By using SSL certificates, we can ensure that the data being replicated is secure and can only be accessed by authorized parties. Additionally, SSL certificates can also be used to authenticate the master and slave servers, providing an additional layer of security.…
As a programmer or developer, it’s common to encounter files with empty lines that need to be removed for better readability and code organization. While manually removing empty lines can be a tedious and time-consuming task, there are several techniques and tools available to streamline the process. In this article, we’ll explore the most effective ways to delete empty lines from files, making your file editing process faster and more efficient. Delete Empty Lines from a File Command-line tools are a powerful and flexible solution for automating file editing tasks. To remove empty lines using command-line tools, you can use…