Skip to content

Sysadmin grodoudou ntpdate cron 18 06 2012

Yannouk edited this page Jul 5, 2012 · 1 revision

Session

  • user : root
  • host : grodoudou.seizam.com
  • date : 18/06/12 14:09
  • curpath : /home/yannouk

Commands

 [email protected]# date
Mon Jun 18 14:09:19 CEST 2012
 [email protected]# dpkg-reconfigure tzdata
Current default time zone: 'Etc/UTC'
Local time is now:      Mon Jun 18 12:10:11 UTC 2012.
Universal Time is now:  Mon Jun 18 12:10:11 UTC 2012.
 [email protected]# date
* Server rebooted to ensure modification applied widely
Mon Jun 18 12:10:16 UTC 2012
 [email protected]# apt-get update
 [email protected]# apt-get install ntpdate
  • already installed
 [email protected]# cat /etc/default/ntpdate
  • already configured to use ovh ntp servers
 [email protected]# ntpdate-debian
18 Jun 12:11:16 ntpdate[25343]: step time server 213.251.128.249 offset -26.327725 sec
  • Edit /etc/crontab, see [1]
 [email protected]# chmod 770 /root/exec-php-send-daily-report.sh
  • Edit /root/exec-php-send-daily-report.sh, see [2]
 [email protected]# chmod 550 /root/exec-php-send-daily-report.sh
 [email protected]# chmod 770 /root/exec-php-send-report.sh
  • Edit /root/exec-php-send-report.sh, see [3]
 [email protected]# chmod 550 /root/exec-php-send-report.sh

Files

  • [1] Edit /etc/crontab
--- old	2012-06-18 12:12:01.000000000 +0000
+++ new	2012-06-18 12:14:14.000000000 +0000
@@ -16,7 +16,7 @@
 
-# each day at 9 am (debian is fr timezone)
-0 9	* * *	root	/root/exec-php-send-report.sh "extensions/Wikiplaces/updateSubscriptions.php" /var/wikizam/deployed
+# each day at 9 am fr
+0 7	* * *	root	/root/exec-php-send-report.sh "extensions/Wikiplaces/updateSubscriptions.php" /var/wikizam/deployed
 
-# each day at 3 pm (debian is fr timezone)
-0 15	* * *	root	/root/exec-php-send-report.sh "extensions/Wikiplaces/checkNextRenewals.php --deadline=7" /var/wikizam/deployed
+# each day at 3 pm fr
+0 13	* * *	root	/root/exec-php-send-report.sh "extensions/Wikiplaces/checkNextRenewals.php --deadline=7" /var/wikizam/deployed
 
@@ -25,4 +25,7 @@
 
-# each day at 7 am (debian is fr timezone)
-0 7	* * *	root	/root/mysql-daily-backup.sh
+# each day at 7 am fr
+0 5	* * *	root	/root/mysql-daily-backup.sh
+
+# each day at 6 am fr
+0 4	* * *	root	ntpdate-debian >> /var/log/ntpdate-daily-cron.log
 
  • [2] Edit /root/exec-php-send-daily-report.sh
--- old	2012-06-18 12:14:52.000000000 +0000
+++ new	2012-06-18 12:18:37.000000000 +0000
@@ -11,2 +11,5 @@
 
+# Mail subject
+mail_subject="[Report] [Grodoudou]"
+
 
@@ -84,3 +87,3 @@
 		chmod 400 ${previous_report_file}
-		mail -s "${php_file_name} execution report of ${previous_report_date}" ${mail} < ${previous_report_file};
+		mail -s "${mail_subject} ${php_file_name} execution report of ${previous_report_date}" ${mail} < ${previous_report_file};
 	fi
  • [3] Edit /root/exec-php-send-report.sh
--- old	2012-06-18 12:20:04.000000000 +0000
+++ new	2012-06-18 12:20:36.000000000 +0000
@@ -12,2 +12,5 @@
 
+# Mail subject
+mail_subject="[Report] [Grodoudou]"
+
 
@@ -107,2 +110,2 @@
 chmod 400 ${report_file}
-mail -s "${php_file_name} execution report of ${report_date}" ${mail} < ${report_file};
+mail -s "${mail_subject} ${php_file_name} execution report of ${report_date}" ${mail} < ${report_file};
Clone this wiki locally