hello
input from ps can be:
user 29976 29787 2 16:45 ? 00:00:00 rsync -H --timeout=60 --force -av --no-owner --no-group --log-file=/tmp/rsync.1448639132.log --include-from=/tmp/sycnzKVqT ....
but options can also be in another order, like:
user 29976 29787 2 16:45 ? 00:00:00 rsync -H --timeout=60 --force -av --log-file=/tmp/rsync.1448639132.log --no-owner --no-group --include-from=/tmp/sycnzKVqT ....
i need to get what log name is used the the running rsync
i could do it using awk if the position is always the same but don't know how to get it when it changes...
I was thinking to get all from field beginning with --log-file to the end of line, then i could easily get log file name using awk -F"[=| ]" ....
thx in advance for a hint.
input from ps can be:
user 29976 29787 2 16:45 ? 00:00:00 rsync -H --timeout=60 --force -av --no-owner --no-group --log-file=/tmp/rsync.1448639132.log --include-from=/tmp/sycnzKVqT ....
but options can also be in another order, like:
user 29976 29787 2 16:45 ? 00:00:00 rsync -H --timeout=60 --force -av --log-file=/tmp/rsync.1448639132.log --no-owner --no-group --include-from=/tmp/sycnzKVqT ....
i need to get what log name is used the the running rsync
i could do it using awk if the position is always the same but don't know how to get it when it changes...
I was thinking to get all from field beginning with --log-file to the end of line, then i could easily get log file name using awk -F"[=| ]" ....
thx in advance for a hint.