# Purge and delete backup files

**URL:** <https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044>\
**Category:** Revit\
**Tags:** revit, dynamo\
**Created:** [July 1, 2025, 2:34pm UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044 "2025-07-01T14:34:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![yohann.heuze1](https://avatars.discourse-cdn.com/v4/letter/y/3da27b/32.png) [@yohann.heuze1](https://forum.dynamobim.com/u/yohann.heuze1)\
**Post date:** [July 1, 2025, 2:34pm UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044/1 "2025-07-01T14:34:48Z")

</div>

Hello everyone,

Within my company, the projects of the various employees are saved on a “central” PC. We have many old REVIT projects stored on this computer, which are gradually taking up a lot of space. I would like to purge all the projects and at the same time delete all backup files of the “\*.0001.rvt” type.

I started building a dynamo script. I can purge the projects but the “Passstrough” node is not working. The backup files won’t be deleted.

I hope you can help me with my problem. Thank you.

 ![Purge](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/5/c51ef531b404e6a7c1c8c9c2d6b1d04defdf3c49.png)

[Purge éléments non utilisés dans projets.dyn](https://forum.dynamobim.com/uploads/short-url/g088Sa367pED0VXZKy2yI4c379G.dyn) (38.9 KB)

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [July 1, 2025, 2:39pm UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044/2 "2025-07-01T14:39:37Z")

</div>

Hi @yohann.heuze1 and welcome 😉 we have ootb nodes there can do the job for backup files. try look under file system, but i will warn you do it right, really hardcore nodes 😉 😉

 ![Skærmbillede 2025-07-02 014956](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/0/609e7cf72c90c0a8b94f616e908ecc97b40cc84f.png)

---

<div class="post-metadata">

**Author:** ![Brendan\_Cassidy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/brendan_cassidy/32/7685_2.png) [@Brendan\_Cassidy](https://forum.dynamobim.com/u/Brendan_Cassidy)\
**Post date:** [July 2, 2025, 7:26am UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044/3 "2025-07-02T07:26:35Z")

</div>

I would suggest the following is a better solution as it should mitigate false positives.

With a double asterix and double full stops can help you mitigate false positions where the file naming could contain 000 within:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/5/155354164b99bafd8368ed0a64a03b40576ba203.jpeg)

Edit: Also using this method could mitigate it not finding “.0010.rvt” as a possible file to delete when it will need to delete.

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [July 2, 2025, 7:28am UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044/4 "2025-07-02T07:28:07Z")

</div>

heheh @Brendan_Cassidy yeah sure, nice one 😉 😉

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [July 2, 2025, 7:38am UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044/5 "2025-07-02T07:38:07Z")

</div>

but what worries me the most is when we use filesystem delete, it seems not goes to bin…and another i guess is danger, is delete directory, and move directory etc…probably just me 😉 😉

---

<div class="post-metadata">

**Author:** ![Brendan\_Cassidy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/brendan_cassidy/32/7685_2.png) [@Brendan\_Cassidy](https://forum.dynamobim.com/u/Brendan_Cassidy)\
**Post date:** [July 2, 2025, 7:51am UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044/6 "2025-07-02T07:51:14Z")

</div>

I fully agree with you, but that can all depend on how the companies network drives are setup for if it is or is not a issue.

---

<div class="post-metadata">

**Author:** ![yohann.heuze1](https://avatars.discourse-cdn.com/v4/letter/y/3da27b/32.png) [@yohann.heuze1](https://forum.dynamobim.com/u/yohann.heuze1)\
**Post date:** [July 2, 2025, 8:00am UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044/7 "2025-07-02T08:00:06Z")

</div>

First of all, thank you for your quick feedback.

I’m not worried about deleting the backup files because I’m going to purge the old files, and the deletion will only apply to the “_.0001.rvt" and "_.0001.rte” files. There won’t be any backup files other than the ones I generate.

I’ll test it and let you know.

---

<div class="post-metadata">

**Author:** ![rajeshjamariya16](https://avatars.discourse-cdn.com/v4/letter/r/58956e/32.png) [@rajeshjamariya16](https://forum.dynamobim.com/u/rajeshjamariya16)\
**Post date:** [July 2, 2025, 9:17am UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044/8 "2025-07-02T09:17:53Z")

</div>

Very Cool!! Thanks!

---

<div class="post-metadata">

**Author:** ![yohann.heuze1](https://avatars.discourse-cdn.com/v4/letter/y/3da27b/32.png) [@yohann.heuze1](https://forum.dynamobim.com/u/yohann.heuze1)\
**Post date:** [July 2, 2025, 11:36am UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044/9 "2025-07-02T11:36:19Z")

</div>

Sorry, but the screenshot of my script and dyn file was not visible. I edited my post.

---

<div class="post-metadata">

**Author:** ![yohann.heuze1](https://avatars.discourse-cdn.com/v4/letter/y/3da27b/32.png) [@yohann.heuze1](https://forum.dynamobim.com/u/yohann.heuze1)\
**Post date:** [July 2, 2025, 11:37am UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044/10 "2025-07-02T11:37:46Z")

</div>

My problem is that “Passthrough” isn’t working. I purge the projects and then immediately try to delete the created backup files.

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [July 2, 2025, 11:47am UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044/11 "2025-07-02T11:47:52Z")

</div>

not sure, try some transaction nodes , maybe

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [July 2, 2025, 3:51pm UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044/12 "2025-07-02T15:51:55Z")

</div>

try purge first, and then use that for wait and then delete the backup files

 ![Skærmbillede 2025-07-02 174901](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/5/552e147bf309f1a2ad3ef2bf9e87bc1b6e07d8b4.jpeg)

---

<div class="post-metadata">

**Author:** ![yohann.heuze1](https://avatars.discourse-cdn.com/v4/letter/y/3da27b/32.png) [@yohann.heuze1](https://forum.dynamobim.com/u/yohann.heuze1)\
**Post date:** [July 3, 2025, 6:34am UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044/13 "2025-07-03T06:34:35Z")

</div>

Thank you very much, I just tested it and it works very well. The files are cleaned and the backup files are deleted. Thank you for your efficiency and quick response.

---

<div class="post-metadata">

**Author:** ![yohann.heuze1](https://avatars.discourse-cdn.com/v4/letter/y/3da27b/32.png) [@yohann.heuze1](https://forum.dynamobim.com/u/yohann.heuze1)\
**Post date:** [July 11, 2025, 1:30pm UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044/14 "2025-07-11T13:30:35Z")

</div>

Hello,

Since I have a multitude of files to purge and each one will generate a backup file, I will end up with saturated hard drives before the end of the command. Would it be possible to open the first file, purge it, save, close, delete the backup file before moving on to the second and so on ?

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 11, 2025, 1:41pm UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044/15 "2025-07-11T13:41:58Z")

</div>

It is doable, but you’d have to go about things in a more complex way.

How many files do you actually have here? What is their total size in GB? What is the directory structure?

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [July 11, 2025, 2:14pm UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044/16 "2025-07-11T14:14:29Z")

</div>

yeah i probably dont understand, I have never be in a project where this could be a problem…just build some more datacenters,with dynamo …hehhe

---

<div class="post-metadata">

**Author:** ![yohann.heuze1](https://avatars.discourse-cdn.com/v4/letter/y/3da27b/32.png) [@yohann.heuze1](https://forum.dynamobim.com/u/yohann.heuze1)\
**Post date:** [July 11, 2025, 2:32pm UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044/17 "2025-07-11T14:32:44Z")

</div>

If I take the first user, I get 558 projects for a total of 82.8 GB

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 11, 2025, 2:56pm UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044/18 "2025-07-11T14:56:25Z")

</div>

You’re purging users’s local models, not the central model? This seems problematic.

---

<div class="post-metadata">

**Author:** ![yohann.heuze1](https://avatars.discourse-cdn.com/v4/letter/y/3da27b/32.png) [@yohann.heuze1](https://forum.dynamobim.com/u/yohann.heuze1)\
**Post date:** [July 21, 2025, 3:27pm UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044/20 "2025-07-21T15:27:18Z")

</div>

I’ve made progress in developing the script by adding the ability to export various data to an Excel file. I’m getting the microphone number, username, number of files processed, file size before and after the purge, the difference, etc.

The Excel file is correctly populated. The tab name retrieves the microphone name.

However, during the purge, error messages appear, and I don’t want to have to validate each message. I’d like Dynamo to do this automatically.

Could you suggest a solution, please ?

[SYNTHESE.xlsx](https://forum.dynamobim.com/uploads/short-url/87ErEPVJKowLBgzJiYHmtScJQPG.xlsx) (10,5 Ko)

[Purge des éléments non utilisés dans projets.dyn](https://forum.dynamobim.com/uploads/short-url/h2py8KLUyicVEVq6acBcW6zDjdJ.dyn) (276,7 Ko)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 21, 2025, 3:30pm UTC](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044/21 "2025-07-21T15:30:58Z")

</div>

I don’t understand the issue you’re facing…

[Next page](https://forum.dynamobim.com/t/purge-and-delete-backup-files/111044.md?page=2)
