Skip to main content

Script for release the RAM cache everyday

# This is the script for release the memory cache everyday #
top -b -n 1 | head > /tmp/file1.txt
sleep 10
sync; echo 1 > /proc/sys/vm/drop_caches
sleep 20
top -b -n 1 | head  > /tmp/file2.txt
cat /tmp/file1.txt /tmp/file2.txt > /tmp/ram.txt

EMAIL_BODY="
Hello Sysadmin Team,

This is the RAM status after releases:
$(cat /tmp/ram.txt)
Thanks,
DC Team
"

echo "Subject: RAM status for ABC Server" "$EMAIL_BODY" | /opt/zimbra/postfix-2.10.3.2z/sbin/sendmail -t alert@domain.com.

The Above Script will clear the Unused RAM . This will send the email before and after Clearing the RAM.
Use This script when very Less number of users are using the server.This script will run on Linux Server (RedHat/Centos).The Script can be run during Night Time using Crontab.

Kindly update the Email ID and Sendmail path correctly as per  your server.

Comments

Popular posts from this blog

Password Expiry notification for the users in zimbra 8.x within 7 Days for the email users

This Script will run as cron tab daily basis and it will alert the users for whom password is going to expire within 7 days. It will also alert admin for the users for whom password expired. Kindly replace the domain.com with your own domain name and the  /opt/zimbra/postfix-2.10.3.2z/sbin/sendmail  path to the actual path of postfix #!/bin/bash #Script for zimbra password expiry email notification. # Meant to be performed as daily cronjob run as zimbra user.  # redirect output to a file to get a 'log file' of sorts. # Time taken of script; echo "$SECONDS Started on: $(date)" # Set variables: # First notification in days, then last warning: FIRST="7" LAST="3" # pass expiry in days, we are assuming passwd exiry is 150 Days POLICY="150" # Sent from: FROM="admin@domain.com" # Get all users - it should run once only. USERS=$(ionice -c3 /opt/zimbra/bin/zmprov -l gaa domain.com) #Todays date, in seconds: DATE

How to Create a Delegated Admin Account in Zimbra 8.x

How to Create a Delegated Admin Account in Zimbra 8.x. Create a File as shown below with the contents .  Replace the domain.com and helpdesk Email id with your domain and helpdesk (Delegated Admin ) Name. #vi admindelegate #!/bin/bash # $1 domain.com # $2 helpdesk zmprov ma $2 zimbraIsDelegatedAdminAccount TRUE zmprov ma $2 zimbraAdminConsoleUIComponents cartBlancheUI zimbraAdminConsoleUIComponents domainListView zimbraAdminConsoleUIComponents accountListView zimbraAdminConsoleUIComponents DLListView zmprov ma $2 zimbraDomainAdminMaxMailQuota 0 zmprov grantRight domain $1 usr $2 +createAccount zmprov grantRight domain $1 usr $2 +createAlias zmprov grantRight domain $1 usr $2 +createCalendarResource zmprov grantRight domain $1 usr $2 +createDistributionList zmprov grantRight domain $1 usr $2 +deleteAlias zmprov grantRight domain $1 usr $2 +listDomain zmprov grantRight domain $1 usr $2 +domainAdminRights zmprov grantRight domain $1 usr $2 +configureQuota zmprov g

sendmail complete cofiguration with pop3 and squirrelmail

Sendmail Introduction Sendmail implements a general purpose internetwork mail routing facility. This document explain how to install sendmail and run an email server which will send and receive mail using the SMTP protocol. An IMAP or POP3 server is required to retrieve mail using Eudora or MS Outlook. Sendmail does not offer POP3 or IMAP services. Installation Prerequisites You should have a basic knowledge of UNIX and DNS. The server should allow incoming connections to the SMTP service which will be listening on TCP port 25. The server should have a fully qualified hostname (FQDN) such as mail.example.net. The hostname should resolve to an A record. It should not be a CNAME. The MX record for the domain for which you wish to receive mail should point to the hostname of your server. There should a PTR record for the IP address of your server. Mail from your server may be rejected if there is no reverse DNS. Installing sendmail Download the sendmail