On 29. jan. 2017 19:25, Scuderia FormulaOne wrote:
I would like to get the most recent file, in a specific directory, from remote nodes:I am thinking about running a command similar to: ls -lrt /tmp/backup |tail -1 | awk '{print $9} then putting the results of that in the fetch command. Any suggestions? Does this seem like a good path?
I think this is you only option since Ansible doesn't have any modules to do this, but you can make it a little shorter by removing -l.
ls -t /tmp/backup | head -1 or ls -tr /tmp/backup | tail -1 -- Kai Stian Olstad -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/bb3c7bb3-225e-fa94-5f04-5d1538b0584f%40olstad.com. For more options, visit https://groups.google.com/d/optout.
