|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Senior Member
Iscritto dal: Jun 2001
Città: Pordenone
Messaggi: 1216
|
Dubbio su cron
Ho un serverino con la Sarge minimale, apache2+mysql+php4+samba.
Ieri notte mi sono fatto uno scriptino x backupparmi le directory /var/www e /var/lib/mysql: Codice:
#!/bin/bash s_path="/var/backups/" s_filename="bk"$(date +%d%m%Y)".tar.gz" s_target=$s_path$s_filename tar czvfP "$s_target" /var/lib/mysql/ /var/www/ >> /dev/null echo [$(date +%d)/$(date +%m)/$(date +%Y):$(date +%T)] Backup done: $s_filename >> /var/log/backup.log Codice:
root 1982 0.0 0.6 1756 820 ? Ss 12:04 0:00 /usr/sbin/cron root 2063 0.0 0.3 1536 456 pts/0 S+ 13:53 0:00 grep cron Allora gli piazzo lo script sotto /etc/cron.daily/, riavvio /etc/init.d/cron (serviva?)... aspetto l'ora fatidica e non succede nulla. Questo è il contenuto di crontab: Codice:
# /etc/crontab: system-wide crontab # Unlike any other crontab you don't have to run the `crontab' # command to install the new version when you edit this file. # This file also has a username field, that none of the other crontabs do. SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # m h dom mon dow user command 17 * * * * root run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily 47 6 * * 7 root test -x /usr/sbin/anacron || run-parts --report /etc/cron.weekly 52 6 1 * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.monthly # Codice:
10 12 * * * root /etc/cron.daily/backup.sh *EDIT* Ovvio che lanciandolo a mano backup.sh mi crea il file compresso correttamente. Ovvio anche che gli ho dato il chmod +x al file... |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 02:16.