List available shells
cat etc/shells
Where is bash located
which bash
Create script file
touch clea-ram.sh
#! /bin/bash
su -c "echo 1 >'/proc/sys/vm/drop_caches' && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared'" root
to save file in nano
Ctrl + x
yes
enter
cat to see content
chmod +x clear-ram.sh
We want these permissions
-rwxrwxr-x
or
chmod 775 clear-ram.sh
Running cron jobs from crontab -e)
add this line to crontab
0 3 * * * /home/scripts/clear-ram.sh
crontab -l to view
As per video
IT Consultant
www.inCOREporation.com
No comments:
Post a Comment