# local command based on timestamp before another file?

**URL:** <https://forum.ansible.com/t/local-command-based-on-timestamp-before-another-file/20511>\
**Category:** Ansible Project\
**Created:** [February 10, 2016, 1:33pm UTC](https://forum.ansible.com/t/local-command-based-on-timestamp-before-another-file/20511 "2016-02-10T13:33:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixel\_fairy](https://avatars.discourse-cdn.com/v4/letter/p/6f9a4e/32.png) [@pixel\_fairy](https://forum.ansible.com/u/pixel_fairy)\
**Post date:** [February 10, 2016, 1:33pm UTC](https://forum.ansible.com/t/local-command-based-on-timestamp-before-another-file/20511/1 "2016-02-10T13:33:16Z")

</div>

Theres probably a better way to do this, so please tell me.

for a given linux host, the netfilter rules for ipv4 and ipv6 are the same, except for when i run it in vagrant, because i dont to cut off my vagrant host.  
10.0.2.15 is the ip address vagrant gives you, and before running ansible, i have a shell provisioner that sets the default gateway to another vagrant box acting as an isp.  
this makes that interface ansible\_default\_ipv4.interface. since its the same interface for v6, this is how i generate those rules.

grep -v 10.0.2.15 rules.v4 \> rules.v6

i dont want to forget to run that. is there a way trigger a local command based on the timestamps? i realize in this case, it would be trivial just let it always run, but it got me curious.
