When does /tmp get cleared?

That depends on your distribution. On some system, it’s deleted only when booted, others have cronjobs running deleting items older than n hours. On Ubuntu 14: using tmpreaper which gets called by /etc/cron.daily, configured via /etc/default/rcS and /etc/tmpreaper.conf. (Credits to this answer). On Ubuntu 16: using tmpfiles.d. (Credits to this answer). On other Debian-like systems: … Read more

How to check if a library is installed?

To do this in a distro-independent* fashion you can use ldconfig with grep, like this: ldconfig -p | grep libjpeg If libjpeg is not installed, there will be no output. If it is installed, you will get a line for each version available. Replace libjpeg by any library you want, and you have a generic, … Read more

How to run a command multiple times, using bash shell?

I don’t think a command or shell builtin for this exists, as it’s a trivial subset of what the Bourne shell for loop is designed for and implementing a command like this yourself is therefore quite simple. Per JimB’s suggestion, use the Bash builtin for generating sequences: for i in {1..10}; do command; done For … Read more

When does `cron.daily` run?

For the distributions you mention: On CentOS 5.4 (Should be same for RHEL5) grep run-parts /etc/crontab 01 * * * * root run-parts /etc/cron.hourly 02 4 * * * root run-parts /etc/cron.daily 22 4 * * 0 root run-parts /etc/cron.weekly 42 4 1 * * root run-parts /etc/cron.monthly So cron.daily runs at 04:02am. Same on … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)