CRON scripts to running in seconds interval Rumi, June 6, 2014 This problem can be solved with simple bash script. For example, if you need to run a PHP script on every 20 seconds, you can create a bash script like this: #!/bin/bash #Name:myscript.sh #Desc:Run script in every 20 seconds while (sleep 20 && php /path_to_your_script/your_script_name.php) & do wait $! done Then, make script executable, and add it to the system startup. That’s all. Related Scripts BashCron
Delete files older than 10 days using shell command October 28, 2023 find is the common tool for this kind of task : find ./my_dir -mtime +10 -type f -delete EXPLANATIONS ./my_dir your directory (replace with your own) -mtime +10 older than 10 days -type f only files -delete no surprise. Remove it to test your find filter before executing the whole command Src: https://stackoverflow.com/questions/13489398/delete-files-older-than-10-days-using-shell-script-in-unix Related Read More
Very Generic Linux Service Watchdog script June 16, 2016 A strong watchdog script- indeed! #!/bin/bash # # watchdog # # Run as a cron job to keep an eye on what_to_monitor which should always # be running. Restart what_to_monitor and send notification as needed. # # This needs to be run as root or a user that can start… Read More
PHPSysinfo CentOS 7 Installer Script January 23, 2024 Intended to to deploy on a barebone fresh CentOS installation with Apache and PHP- !#/bin/sh ################################################# # Server Configuration for Centos 6.8 Final # # Don’t use port 7071 # Updated by Rumi- hasan@servermart.net # ################################################# ## updating packages sudo yum update -y ## installing dependencies sudo yum install unzip… Read More