Search files from the terminal on Linux using locate

sudo apt-get install locate

Using locate Command

locate LAMP-Setup.odt
locate "*.html"

Ignore Case Sensitive Locate Outputs

locate -i *text.txt*

Refresh mlocate Database

Since locate command relies on a database called mlocate. The said database needs to be updated regularly for the command utility to work efficiently

sudo updatedb

Display Only Files Present in Your System

locate -i -e *text.txt*

Review Your Locate Database

locate -S

Limit Search Queries to a Specific Number

locate "*.html" -n 20

Display The Number of Matching Entries

locate -c [tecmint]*

References
https://www.howtoforge.com/tutorial/linux-search-files-from-the-terminal/
https://www.tecmint.com/linux-locate-command-practical-examples/

Scheduled backup MongoDB database using mongodump and cron

mkdir backup
touch monitoring.sh
#!/bin/bash
 
currentDate=`date +"%Y%m%d%H%M"`
dirName="monitoring_$currentDate"
filePath=/home/mahmood/backup/$dirName
mkdir $filePath
mongodump --db monitoring --out $filePath
sudo chmod +x monitoring.sh
sudo crontab -e
30 4 * * * /home/mahmood/backup/monitoring.sh

References
https://stackoverflow.com/questions/35574603/run-cron-job-everyday-at-specific-time
https://tecadmin.net/get-current-date-and-time-in-bash/
https://askubuntu.com/questions/350861/how-to-set-a-cron-job-to-run-a-shell-script
https://coderwall.com/p/hdmmnq/easy-automatic-nightly-backups-for-mongodb