сохранить вывод crontab в новый файл каждый раз?

Для основанных на схеме полномочий SELECT * FROM information_schema.schema_privileges

2
задан 26 April 2011 в 13:51
2 ответа

Вы могли использовать дату и время для создания уникального имени файла

15 * * * * myscript.sh > ~/logs/log.$(/bin/date +\%Y\%m\%d\%H\%M\%S).txt

Это создаст файлы, названные как ~/logs/log.20110426121501.txt

7
ответ дан 3 December 2019 в 09:08
if you can't use the date as answered by Iain
from your script output a watermark like ### 
this is what I have into test.txt

###
test
###
test1

then to process it 
shell$ awk -F "###"  {'print $1'} test.txt

test

test1

i have the delimiter changed from ' ' into awk to '###' and then just print the lines
0
ответ дан 3 December 2019 в 09:08

Теги

Похожие вопросы