[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bashscript in cronjob packen



Hallo Evgeni,

Danke für Deinen Tipp!

Am Tue, 15 Aug 2006 18:14:39 +0200 schrieb Evgeni Golov:

> Cron kennt weder $HOME noch $PATH. Und nach date fehlt n space.
> mach mal draus ein >/path/to/`/bin/date +%y%m%d-%k_%M`-dirlist

Zwischen date und + war ein blank das ist beim c&p verloren gegangen.

Und die Lösung habe ich jetzt auch gefunden. Sogar 3 Möglichkeiten:
(Für die Nachwelt)

52 20 * * * /usr/bin/du -xh --max-depth 2 / > \ 
/root/`/bin/date '+\%y\%m\%d-\%k_\%M'`-DirList.txt 

54 20 * * * /usr/bin/du -xh --max-depth 2 / > \
/root/$(/bin/date +\%y\%m\%d-\%k_\%M)-DirList.txt 

55 20 * * * /usr/bin/du -xh --max-depth 2 / > \
/root/$(/bin/date '+\%y\%m\%d-\%k_\%M')-DirList.txt

Viele Grüße 
Ralf Schmidt


-- 
Signatur ist in Urlaub



Reply to: