# Finden und löschen

**URL:** https://discourse.nodered.org/t/finden-und-loschen/53787
**Category:** Developing Nodes
**Created:** [15 November 2021 19:42 UTC](https://discourse.nodered.org/t/finden-und-loschen/53787 "2021-11-15T19:42:49Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Herbert](https://avatars.discourse-cdn.com/v4/letter/h/ce73a5/32.png) [@Herbert](https://discourse.nodered.org/u/Herbert)
#### Post date: [15 November 2021 19:42 UTC](https://discourse.nodered.org/t/finden-und-loschen/53787/1 "2021-11-15T19:42:49Z")

</div>

Hallo. Ich nutze die SSD um von der Kamera Bilder zu speichern. Nach einiger Zeit müssen die Bilder gelöscht werden.

Den Befehl Dateien nach 60 Tagen zu löschen wollte ich hiermit machen, geht aber nicht:  
find /media/Kamera/ -type f -mtime +60 -exec rm  
sudo find /media/Kamera/ -type f -mtime +60 -exec rm  
geht auch nicht.

Die Dateien älter 60 Tage sollen also täglich gelöscht werden.

Wie kann ich das machen?

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [15 November 2021 20:27 UTC](https://discourse.nodered.org/t/finden-und-loschen/53787/2 "2021-11-15T20:27:17Z")

</div>

Auto-translation:

> [@Herbert](#):
>
> ‎Hello. I use the SSD to store images from the camera. After some time, the pictures need to be deleted.‎
> 
> ‎I wanted to make the command to delete files after‎  
> ‎ 60 days, but it doesn't work: find‎  
> ‎ /media/Camera/ -type f -mtime +60 -exec rm sudo find /media/Camera/ -type f -mtime +60 -exec rm‎  
> ‎ is also not possible.‎
> 
> ‎The files older than 60 days should therefore be deleted daily.‎
> 
> ‎How can I do this?‎

I don't think this is about creating nodes is it?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [15 November 2021 20:46 UTC](https://discourse.nodered.org/t/finden-und-loschen/53787/3 "2021-11-15T20:46:59Z")

</div>

If you mean that the command works outside node-red but not inside then the problem is probably due to the use of `sudo`, since node red cannot ask for a password. Make sure the the user running node-red has write access to the folder and then it should work without sudo.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [14 January 2022 20:47 UTC](https://discourse.nodered.org/t/finden-und-loschen/53787/4 "2022-01-14T20:47:12Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
