# Turn off Gateway or store & forward per factory schedule

**URL:** <https://forum.inductiveautomation.com/t/turn-off-gateway-or-store-forward-per-factory-schedule/71279>\
**Category:** General Discussion\
**Created:** [March 19, 2023, 1:51am UTC](https://forum.inductiveautomation.com/t/turn-off-gateway-or-store-forward-per-factory-schedule/71279 "2023-03-19T01:51:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![user5](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/user5/32/39393_2.png) [@user5](https://forum.inductiveautomation.com/u/user5)\
**Post date:** [March 19, 2023, 1:51am UTC](https://forum.inductiveautomation.com/t/turn-off-gateway-or-store-forward-per-factory-schedule/71279/1 "2023-03-19T01:51:14Z")

</div>

Our factory runs 4 days and is off for 3 days. While most of the tags are setup for recording data in historian on % change, we still get huge amount of data recorded while the factory is not running.

Is there a clean way to turn off gateway or S&F based on schedule?

---

<div class="post-metadata">

**Author:** ![humphrey.daniel](https://avatars.discourse-cdn.com/v4/letter/h/8e8cbc/32.png) [@humphrey.daniel](https://forum.inductiveautomation.com/u/humphrey.daniel)\
**Post date:** [March 19, 2023, 7:50am UTC](https://forum.inductiveautomation.com/t/turn-off-gateway-or-store-forward-per-factory-schedule/71279/2 "2023-03-19T07:50:10Z")

</div>

I'm not sure if the solution you asked for is possible. The problem appears to be that you store data when there's not activity.

One idea is to perform periodic maintenance, deleting all data between active dates. You could set up a maintenance plan (Microsoft SQL server) to run at some interval. It can run an statement or SP that deletes the data that exists in whatever timespans you need. This makes sense if you have storage concerns.

If space isn't a concern, whenever you query the data, you can neglect the time between active states. This aligns more with the idea of storing everything and transforming as needed.

---

<div class="post-metadata">

**Author:** ![user5](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/user5/32/39393_2.png) [@user5](https://forum.inductiveautomation.com/u/user5)\
**Post date:** [March 20, 2023, 2:53pm UTC](https://forum.inductiveautomation.com/t/turn-off-gateway-or-store-forward-per-factory-schedule/71279/3 "2023-03-20T14:53:51Z")

</div>

Thank you @humphrey.daniel

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 20, 2023, 3:14pm UTC](https://forum.inductiveautomation.com/t/turn-off-gateway-or-store-forward-per-factory-schedule/71279/4 "2023-03-20T15:14:16Z")

</div>

If you use a driven tag group for all your historical tags, you could disable the driving tag whenever operations are not running?
