script delete files with subfolder
script delete files with subfolder
Hello, can someone help me, this NAS is connected by ftp to a camera recorder, and it would need the files to be deleted automatically through a script. 
Re: script delete files with subfolder
I do this in Scheduled Tasks:
Find and delete different types of files (P* are regular pictures; A* are alarm generated in my system) and dvr recordings all at varying age (6 days; 120 days. Prints an output of all files deleted which is both logged and emailed to my admin account.
Code: Select all
find /Volume2/IPCAM/ -name P*.jpg -mtime +6 -print -delete
find /Volume2/IPCAM/ -name A*.jpg -mtime +120 -print -delete
find /Volume2/IPCAM/ -type d -empty -print -delete
find /Volume2/DVR/ -name *.storage -mtime +120 -print -delete
find /Volume2/DVR/ -type d -empty -print -delete
F5-221 TOS7.0.0777 - 4x4TB (Ironwolf) Traid
F2-424 TOS7.0.0777 - 2x500GB nvme (P3) Traid, 2x6TB HDD (HGST) Traid
F2-221 TOS7.0.0777 - 1x3TB Ext4, 1x4TB Btrfs
F2-425+ TOS7.0.0777 - 2x500GB nvme (P3) Traid, 2x6TB HDD (EXOS) Traid
F2-424 TOS7.0.0777 - 2x500GB nvme (P3) Traid, 2x6TB HDD (HGST) Traid
F2-221 TOS7.0.0777 - 1x3TB Ext4, 1x4TB Btrfs
F2-425+ TOS7.0.0777 - 2x500GB nvme (P3) Traid, 2x6TB HDD (EXOS) Traid
Re: script delete files with subfolder
In tos 4.2 and e tos 5 can I do this script? In tos 4.2 it is understood that it is done through ssh?
Re: script delete files with subfolder
I have never used TOS4, so I can't comment. If you have a method to run cron, you can run individual commands or a script. Of course, you cannot run the exact commands in the example You would have to modify them to suit your environment. And, naturally, it would help if you told people what your environment is. There are no clues in your original post and I gave up crystal gazing years ago. 
F5-221 TOS7.0.0777 - 4x4TB (Ironwolf) Traid
F2-424 TOS7.0.0777 - 2x500GB nvme (P3) Traid, 2x6TB HDD (HGST) Traid
F2-221 TOS7.0.0777 - 1x3TB Ext4, 1x4TB Btrfs
F2-425+ TOS7.0.0777 - 2x500GB nvme (P3) Traid, 2x6TB HDD (EXOS) Traid
F2-424 TOS7.0.0777 - 2x500GB nvme (P3) Traid, 2x6TB HDD (HGST) Traid
F2-221 TOS7.0.0777 - 1x3TB Ext4, 1x4TB Btrfs
F2-425+ TOS7.0.0777 - 2x500GB nvme (P3) Traid, 2x6TB HDD (EXOS) Traid
Re: script delete files with subfolder
Hello How did you mount your FTP to acceede to Camera SD card ?
Re: script delete files with subfolder
Not sure I follow. FTP is FTP
FTP server opens a port(s) and you allocate appropriate space and permissions for that space. Your camera then communicates with the server port using ftp client built into the camera(s). My (cheap, chinese) cameras operate without an sd card but that limits me to only sending pictures to the server (NAS in this case). Video output requires the sd card to record video and then that can be sent to ftp server. (But I don't need the video output to the NAS as I already have Hybrid DVR recording everything.) I have been testing Surveillance Manager, but it is lacking some functions for me.
F5-221 TOS7.0.0777 - 4x4TB (Ironwolf) Traid
F2-424 TOS7.0.0777 - 2x500GB nvme (P3) Traid, 2x6TB HDD (HGST) Traid
F2-221 TOS7.0.0777 - 1x3TB Ext4, 1x4TB Btrfs
F2-425+ TOS7.0.0777 - 2x500GB nvme (P3) Traid, 2x6TB HDD (EXOS) Traid
F2-424 TOS7.0.0777 - 2x500GB nvme (P3) Traid, 2x6TB HDD (HGST) Traid
F2-221 TOS7.0.0777 - 1x3TB Ext4, 1x4TB Btrfs
F2-425+ TOS7.0.0777 - 2x500GB nvme (P3) Traid, 2x6TB HDD (EXOS) Traid

