Linux scheduled task crontab is not effective

After using the command "service crond status" to check, the following information appears: "Cron: pam_unix (cron:session): session opened/closed for user root by (uid=0)".

This is because cron can run at a configured interval. When cron performs this operation, it usually runs as the root user, creating a session for the specified user.

To make the necessary modifications:

  1. Go to the directory /etc/pam.d.

  2. Open the file named common-session-noninteractive.

  3. Search for the content "session required pam_unix.so" (usually at the end).

  4. Above this line, add the following:

session [success=1 default=ignore] pam_succeed_if.so service in cron quiet use_uid

  1. Save and exit the file.

  2. Restart the crond service (or cron for Ubuntu).

Now you can give it a try, and it should work.

For example, "name@something.com". If someone replies to you it will be via email.
For example, "http://someaddress.com"