I'm writing a script to run automated backups with tar and cron. I want to include /var and /etc but this requires sudo.
Since it's automated and occurs nightly, I'm not present to input the password, so it fails for the moment.
Should I edit the sudoers file allowing to run this script without password or do you have any other suggestion ?
I think the suggestion of @pLumo should work but for some reason I couldn't make it.
I edited the sudo crontab as such
* * * * * /home/jmaurice/script.sh
and script.sh, which should run every minute :
#!/bin/zsh
echo "Salut tout le monde" >> /home/jmaurice/echo.txt 2&> /home/jmaurice/err.txt
what am I missing ?
ls -l gives :
-rwxr-xr-x 1 jmaurice jmaurice 63 Aug 5 09:35 script.sh
@Raffa
Requested output, it's still set to run every minute.
Aug 05 14:29:01 kali CRON[289179]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:29:01 kali CRON[289179]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:29:01 kali CRON[289179]: pam_unix(cron:session): session closed for user root
Aug 05 14:30:01 kali CRON[289662]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:30:01 kali CRON[289662]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:30:01 kali CRON[289662]: pam_unix(cron:session): session closed for user root
Aug 05 14:31:01 kali CRON[290137]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:31:01 kali CRON[290137]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:31:01 kali CRON[290137]: pam_unix(cron:session): session closed for user root
Aug 05 14:32:01 kali CRON[290622]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:32:01 kali CRON[290622]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:32:01 kali CRON[290622]: pam_unix(cron:session): session closed for user root
Aug 05 14:33:01 kali CRON[291108]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:33:01 kali CRON[291108]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:33:01 kali CRON[291108]: pam_unix(cron:session): session closed for user root
Aug 05 14:34:01 kali CRON[291591]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:34:01 kali CRON[291591]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:34:01 kali CRON[291591]: pam_unix(cron:session): session closed for user root
Aug 05 14:35:01 kali CRON[292074]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:35:01 kali CRON[292075]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:35:01 kali CRON[292075]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:35:01 kali CRON[292075]: pam_unix(cron:session): session closed for user root
Aug 05 14:35:01 kali CRON[292074]: pam_unix(cron:session): session closed for user root
Aug 05 14:36:01 kali CRON[292561]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:36:01 kali CRON[292561]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:36:01 kali CRON[292561]: pam_unix(cron:session): session closed for user root
Aug 05 14:37:01 kali CRON[293045]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:37:01 kali CRON[293045]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:37:01 kali CRON[293045]: pam_unix(cron:session): session closed for user root
Aug 05 14:38:01 kali CRON[293535]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:38:01 kali CRON[293535]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:38:01 kali CRON[293535]: pam_unix(cron:session): session closed for user root
Aug 05 14:39:01 kali CRON[294088]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:39:01 kali CRON[294089]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:39:01 kali CRON[294088]: pam_unix(cron:session): session closed for user root
Aug 05 14:39:01 kali CRON[294089]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:39:01 kali CRON[294089]: pam_unix(cron:session): session closed for user root
Aug 05 14:40:01 kali CRON[294573]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:40:01 kali CRON[294573]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:40:01 kali CRON[294573]: pam_unix(cron:session): session closed for user root
Aug 05 14:41:01 kali CRON[295056]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:41:01 kali CRON[295056]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:41:01 kali CRON[295056]: pam_unix(cron:session): session closed for user root
Aug 05 14:42:01 kali CRON[295541]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:42:01 kali CRON[295541]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:42:01 kali CRON[295541]: pam_unix(cron:session): session closed for user root
Aug 05 14:43:01 kali CRON[296020]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:43:01 kali CRON[296020]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:43:01 kali CRON[296020]: pam_unix(cron:session): session closed for user root
Aug 05 14:44:01 kali CRON[296503]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:44:01 kali CRON[296503]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:44:01 kali CRON[296503]: pam_unix(cron:session): session closed for user root
Aug 05 14:45:01 kali CRON[296986]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:45:01 kali CRON[296987]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:45:01 kali CRON[296987]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:45:01 kali CRON[296987]: pam_unix(cron:session): session closed for user root
Aug 05 14:45:01 kali CRON[296986]: pam_unix(cron:session): session closed for user root
Aug 05 14:46:01 kali CRON[297472]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:46:02 kali CRON[297472]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:46:02 kali CRON[297472]: pam_unix(cron:session): session closed for user root
Aug 05 14:47:02 kali CRON[297956]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:47:02 kali CRON[297956]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:47:02 kali CRON[297956]: pam_unix(cron:session): session closed for user root
Aug 05 14:48:01 kali CRON[298438]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:48:01 kali CRON[298438]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:48:01 kali CRON[298438]: pam_unix(cron:session): session closed for user root
Aug 05 14:49:01 kali CRON[298922]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:49:01 kali CRON[298922]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:49:01 kali CRON[298922]: pam_unix(cron:session): session closed for user root
Aug 05 14:50:01 kali CRON[299406]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:50:01 kali CRON[299406]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:50:01 kali CRON[299406]: pam_unix(cron:session): session closed for user root
Aug 05 14:51:01 kali CRON[299889]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:51:01 kali CRON[299889]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:51:01 kali CRON[299889]: pam_unix(cron:session): session closed for user root
Aug 05 14:52:01 kali CRON[300374]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:52:01 kali CRON[300374]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:52:01 kali CRON[300374]: pam_unix(cron:session): session closed for user root
Aug 05 14:53:01 kali CRON[300860]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:53:01 kali CRON[300860]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:53:01 kali CRON[300860]: pam_unix(cron:session): session closed for user root
Aug 05 14:54:01 kali CRON[301344]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:54:01 kali CRON[301344]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:54:01 kali CRON[301344]: pam_unix(cron:session): session closed for user root
Aug 05 14:55:01 kali CRON[301828]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:55:01 kali CRON[301827]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:55:01 kali CRON[301828]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:55:01 kali CRON[301828]: pam_unix(cron:session): session closed for user root
Aug 05 14:55:01 kali CRON[301827]: pam_unix(cron:session): session closed for user root
Aug 05 14:56:01 kali CRON[302305]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:56:01 kali CRON[302305]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:56:01 kali CRON[302305]: pam_unix(cron:session): session closed for user root
Aug 05 14:57:01 kali CRON[302789]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:57:01 kali CRON[302789]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:57:01 kali CRON[302789]: pam_unix(cron:session): session closed for user root
Aug 05 14:58:01 kali CRON[303279]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:58:01 kali CRON[303279]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:58:01 kali CRON[303279]: pam_unix(cron:session): session closed for user root
Aug 05 14:59:01 kali CRON[303762]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 14:59:01 kali CRON[303762]: (CRON) info (No MTA installed, discarding output)
Aug 05 14:59:01 kali CRON[303762]: pam_unix(cron:session): session closed for user root
Aug 05 15:00:01 kali CRON[304245]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:00:01 kali CRON[304245]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:00:01 kali CRON[304245]: pam_unix(cron:session): session closed for user root
Aug 05 15:01:01 kali CRON[304736]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:01:01 kali CRON[304736]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:01:01 kali CRON[304736]: pam_unix(cron:session): session closed for user root
Aug 05 15:02:01 kali CRON[305222]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:02:01 kali CRON[305222]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:02:01 kali CRON[305222]: pam_unix(cron:session): session closed for user root
Aug 05 15:03:01 kali CRON[305707]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:03:01 kali CRON[305707]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:03:01 kali CRON[305707]: pam_unix(cron:session): session closed for user root
Aug 05 15:04:01 kali CRON[306190]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:04:01 kali CRON[306190]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:04:01 kali CRON[306190]: pam_unix(cron:session): session closed for user root
Aug 05 15:05:01 kali CRON[306674]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:05:01 kali CRON[306673]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:05:01 kali CRON[306674]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:05:01 kali CRON[306674]: pam_unix(cron:session): session closed for user root
Aug 05 15:05:01 kali CRON[306673]: pam_unix(cron:session): session closed for user root
Aug 05 15:06:01 kali CRON[307160]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:06:01 kali CRON[307160]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:06:01 kali CRON[307160]: pam_unix(cron:session): session closed for user root
Aug 05 15:07:01 kali CRON[307646]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:07:01 kali CRON[307646]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:07:01 kali CRON[307646]: pam_unix(cron:session): session closed for user root
Aug 05 15:08:01 kali CRON[308129]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:08:01 kali CRON[308129]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:08:01 kali CRON[308129]: pam_unix(cron:session): session closed for user root
Aug 05 15:09:01 kali CRON[308670]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:09:01 kali CRON[308669]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:09:01 kali CRON[308669]: pam_unix(cron:session): session closed for user root
Aug 05 15:09:01 kali CRON[308670]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:09:01 kali CRON[308670]: pam_unix(cron:session): session closed for user root
Aug 05 15:10:01 kali CRON[309254]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:10:01 kali CRON[309254]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:10:01 kali CRON[309254]: pam_unix(cron:session): session closed for user root
Aug 05 15:11:01 kali CRON[309819]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:11:01 kali CRON[309819]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:11:01 kali CRON[309819]: pam_unix(cron:session): session closed for user root
Aug 05 15:12:01 kali CRON[310312]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:12:01 kali CRON[310312]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:12:01 kali CRON[310312]: pam_unix(cron:session): session closed for user root
Aug 05 15:13:01 kali CRON[310822]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:13:01 kali CRON[310822]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:13:01 kali CRON[310822]: pam_unix(cron:session): session closed for user root
Aug 05 15:14:01 kali CRON[311368]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:14:01 kali CRON[311368]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:14:01 kali CRON[311368]: pam_unix(cron:session): session closed for user root
Aug 05 15:15:01 kali CRON[311859]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:15:01 kali CRON[311858]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:15:01 kali CRON[311859]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:15:01 kali CRON[311859]: pam_unix(cron:session): session closed for user root
Aug 05 15:15:01 kali CRON[311858]: pam_unix(cron:session): session closed for user root
Aug 05 15:16:01 kali CRON[312352]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:16:01 kali CRON[312352]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:16:01 kali CRON[312352]: pam_unix(cron:session): session closed for user root
Aug 05 15:17:01 kali CRON[312836]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:17:01 kali CRON[312835]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:17:01 kali CRON[312840]: (root) CMD (cd / && run-parts --report /etc/cron.hourly)
Aug 05 15:17:01 kali CRON[312836]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:17:01 kali CRON[312836]: pam_unix(cron:session): session closed for user root
Aug 05 15:17:01 kali CRON[312835]: pam_unix(cron:session): session closed for user root
Aug 05 15:18:01 kali CRON[313352]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:18:01 kali CRON[313352]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:18:01 kali CRON[313352]: pam_unix(cron:session): session closed for user root
Aug 05 15:19:01 kali CRON[313835]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:19:01 kali CRON[313835]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:19:01 kali CRON[313835]: pam_unix(cron:session): session closed for user root
Aug 05 15:20:01 kali CRON[314310]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:20:01 kali CRON[314310]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:20:01 kali CRON[314310]: pam_unix(cron:session): session closed for user root
Aug 05 15:21:01 kali CRON[314844]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:21:01 kali CRON[314844]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:21:01 kali CRON[314844]: pam_unix(cron:session): session closed for user root
Aug 05 15:22:01 kali CRON[315374]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:22:01 kali CRON[315374]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:22:01 kali CRON[315374]: pam_unix(cron:session): session closed for user root
Aug 05 15:23:01 kali CRON[315862]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:23:01 kali CRON[315862]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:23:01 kali CRON[315862]: pam_unix(cron:session): session closed for user root
Aug 05 15:24:01 kali CRON[316380]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:24:01 kali CRON[316380]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:24:01 kali CRON[316380]: pam_unix(cron:session): session closed for user root
Aug 05 15:25:01 kali CRON[316869]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:25:01 kali CRON[316868]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:25:01 kali CRON[316869]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:25:01 kali CRON[316869]: pam_unix(cron:session): session closed for user root
Aug 05 15:25:01 kali CRON[316868]: pam_unix(cron:session): session closed for user root
Aug 05 15:26:01 kali CRON[317440]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:26:01 kali CRON[317440]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:26:01 kali CRON[317440]: pam_unix(cron:session): session closed for user root
Aug 05 15:27:01 kali CRON[317936]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:27:01 kali CRON[317936]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:27:01 kali CRON[317936]: pam_unix(cron:session): session closed for user root
Aug 05 15:28:01 kali CRON[318477]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Aug 05 15:28:01 kali CRON[318477]: (CRON) info (No MTA installed, discarding output)
Aug 05 15:28:01 kali CRON[318477]: pam_unix(cron:session): session closed for user root