Currently I'm thinking the same - but Iv only got a 1TB space left in total on QNAP with the 11day setting thus my 'attempt' at utilizing the MSD for a short achive.OneCD wrote:Or, you could extend Surveillance Station's overwrite days to something high (like 30 days).
Want to schedule delete files and folders on attached USB drive.
- sharper9
- Know my way around
- Posts: 196
- Joined: Fri Jun 06, 2008 6:10 pm
Re: Want to schedule delete files and folders on attached USB drive.
All the best
TS251A 8GB 2 x 3TB JBOD for LMS and loads of other stuff. 2 Hikvision DS-2CD2342WD-I
Firmware 4.4.3.1354 - Windows 11 + 2 x iPads
TS251A 8GB 2 x 3TB JBOD for LMS and loads of other stuff. 2 Hikvision DS-2CD2342WD-I
Firmware 4.4.3.1354 - Windows 11 + 2 x iPads
- OneCD
- Guru
- Posts: 12146
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
Re: Want to schedule delete files and folders on attached USB drive.
That's OK, you wouldn't be storing 30 days of videos on the NAS. If you use archive-old-stuff.sh once per day, then the excess get shifted out to your USB drive.
- sharper9
- Know my way around
- Posts: 196
- Joined: Fri Jun 06, 2008 6:10 pm
Re: Want to schedule delete files and folders on attached USB drive.
OKOneCD wrote:That's OK, you wouldn't be storing 30 days of videos on the NAS. If you use archive-old-stuff.sh once per day, then the excess get shifted out to your USB drive.
So I need to make sure archive-old-stuff.sh is running once a day, with current configuration?
Anything else?
All the best
TS251A 8GB 2 x 3TB JBOD for LMS and loads of other stuff. 2 Hikvision DS-2CD2342WD-I
Firmware 4.4.3.1354 - Windows 11 + 2 x iPads
TS251A 8GB 2 x 3TB JBOD for LMS and loads of other stuff. 2 Hikvision DS-2CD2342WD-I
Firmware 4.4.3.1354 - Windows 11 + 2 x iPads
- OneCD
- Guru
- Posts: 12146
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
Re: Want to schedule delete files and folders on attached USB drive.
Yes, but you'll need to uncomment the crontab line for archive-old-stuff.sh again, by removing the leading hash character.sharper9 wrote:So I need to make sure archive-old-stuff.sh is running once a day, with current configuration?
Not that I'm aware of. I guess we'll find out.sharper9 wrote:Anything else?
- sharper9
- Know my way around
- Posts: 196
- Joined: Fri Jun 06, 2008 6:10 pm
Re: Want to schedule delete files and folders on attached USB drive.
Code: Select all
[~] # crontab -l
# m h dom m dow cmd
0 3 * * 0 /etc/init.d/idmap.sh dump
0 4 * * * /sbin/hwclock -s
0 3 * * * /sbin/vs_refresh
0 3 * * * /sbin/clean_reset_pwd
0-59/15 * * * * /etc/init.d/nss2_dusg.sh
30 7 * * * /sbin/clean_upload_file
0 2 * * * /sbin/qfstrim
0-59/10 * * * * /etc/init.d/storage_usage.sh
30 3 * * * /sbin/notice_log_tool -v -R
10 15 * * * /usr/bin/power_clean -c 2>/dev/null
10 0 * * * /etc/init.d/antivirus.sh scan 1
0 0 * * * /etc/init.d/antivirus.sh archive_log
08 0 */1 * * /etc/init.d/antivirus.sh update_db
* * * * * /mnt/ext/opt/netmgr/util/lock_timer.sh
35 7 * * * /sbin/qbox_util -c > /dev/null 2>/dev/null
19 * * * * /sbin/qddns_check 2>/dev/null
0 5 * * * /share/50014EE20BA4E444_DATA/.system/archive-old-stuff.sh >>
/share/50014EE20BA4E444_DATA/.system/nvr-archiver.log
*/3 * * * * /etc/config/qsync_init.sh
4 3 * * 3 /etc/init.d/backup_conf.sh
Thanks once again
All the best
TS251A 8GB 2 x 3TB JBOD for LMS and loads of other stuff. 2 Hikvision DS-2CD2342WD-I
Firmware 4.4.3.1354 - Windows 11 + 2 x iPads
TS251A 8GB 2 x 3TB JBOD for LMS and loads of other stuff. 2 Hikvision DS-2CD2342WD-I
Firmware 4.4.3.1354 - Windows 11 + 2 x iPads
- sharper9
- Know my way around
- Posts: 196
- Joined: Fri Jun 06, 2008 6:10 pm
Re: Want to schedule delete files and folders on attached USB drive.
Sadly there has been no transfer to or deletion on MSD.
Are we at end with this as I can quite understand this has go on for good while.
Are we at end with this as I can quite understand this has go on for good while.
All the best
TS251A 8GB 2 x 3TB JBOD for LMS and loads of other stuff. 2 Hikvision DS-2CD2342WD-I
Firmware 4.4.3.1354 - Windows 11 + 2 x iPads
TS251A 8GB 2 x 3TB JBOD for LMS and loads of other stuff. 2 Hikvision DS-2CD2342WD-I
Firmware 4.4.3.1354 - Windows 11 + 2 x iPads
- OneCD
- Guru
- Posts: 12146
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
Re: Want to schedule delete files and folders on attached USB drive.
Can you please post the contents of your log file?sharper9 wrote:Sadly there has been no transfer to or deletion on MSD.
Code: Select all
cat /share/50014EE20BA4E444_DATA/.system/nvr-archiver.log
That's up to you. This can all work, as long as everything is correctly configured. However, I understand if you are frustrated.sharper9 wrote:Are we at end with this as I can quite understand this has go on for good while.
One thing I'm not sure of though is that in your previous posting of crontab, it displays with a line-break just where the displayed output is redirected to the log:
Code: Select all
0 5 * * * /share/50014EE20BA4E444_DATA/.system/archive-old-stuff.sh >>
/share/50014EE20BA4E444_DATA/.system/nvr-archiver.log
This may have just been a copy-paste bug. Can you please confirm that the crontab line actually looks like this in your editor?
Code: Select all
0 5 * * * /share/50014EE20BA4E444_DATA/.system/archive-old-stuff.sh >> /share/50014EE20BA4E444_DATA/.system/nvr-archiver.log
- sharper9
- Know my way around
- Posts: 196
- Joined: Fri Jun 06, 2008 6:10 pm
Re: Want to schedule delete files and folders on attached USB drive.
I would like to get it working.
Im just very aware of he great effort you are putting in.
This is the structure on MSD where the video files on reside
Im just very aware of he great effort you are putting in.
This is the structure on MSD where the video files on reside
I included this as I wondered if might be stopping the deletion of the directory on MSD?I:\channel1\2017-03-13\01.avi
Code: Select all
[~] # cat /share/50014EE20BA4E444_DATA/.system/nvr-archiver.log
runtime: [Tue Apr 11 05:00:02 BST 2017]
- moving excess directories from [/share/Recordings/record_nvr/channel1] to [/share/MySmallDisk/channel1] ...
done.
- deleting excess directories from [/share/MySmallDisk/channel1] ...
done.
runtime: [Tue Apr 11 05:00:02 BST 2017]
- moving excess directories from [/share/Recordings/record_nvr/channel2] to [/share/MySmallDisk/channel2] ...
done.
- deleting excess directories from [/share/MySmallDisk/channel2] ...
done.
runtime: [Wed Apr 12 05:00:02 BST 2017]
- moving excess directories from [/share/Recordings/record_nvr/channel1] to [/share/MySmallDisk/channel1] ...
done.
- deleting excess directories from [/share/MySmallDisk/channel1] ...
done.
runtime: [Wed Apr 12 05:00:02 BST 2017]
- moving excess directories from [/share/Recordings/record_nvr/channel2] to [/share/MySmallDisk/channel2] ...
done.
- deleting excess directories from [/share/MySmallDisk/channel2] ...
done.
runtime: [Thu Apr 13 05:00:02 BST 2017]
- moving excess directories from [/share/Recordings/record_nvr/channel1] to [/share/MySmallDisk/channel1] ...
done.
- deleting excess directories from [/share/MySmallDisk/channel1] ...
done.
runtime: [Thu Apr 13 05:00:02 BST 2017]
- moving excess directories from [/share/Recordings/record_nvr/channel2] to [/share/MySmallDisk/channel2] ...
done.
- deleting excess directories from [/share/MySmallDisk/channel2] ...
done.
runtime: [Fri Apr 14 05:00:02 BST 2017]
- moving excess directories from [/share/Recordings/record_nvr/channel1] to [/share/MySmallDisk/channel1] ...
done.
- deleting excess directories from [/share/MySmallDisk/channel1] ...
done.
runtime: [Fri Apr 14 05:00:02 BST 2017]
- moving excess directories from [/share/Recordings/record_nvr/channel2] to [/share/MySmallDisk/channel2] ...
done.
- deleting excess directories from [/share/MySmallDisk/channel2] ...
done.
runtime: [Sat Apr 15 05:00:02 BST 2017]
- moving excess directories from [/share/Recordings/record_nvr/channel1] to [/share/MySmallDisk/channel1] ...
done.
- deleting excess directories from [/share/MySmallDisk/channel1] ...
done.
runtime: [Sat Apr 15 05:00:02 BST 2017]
- moving excess directories from [/share/Recordings/record_nvr/channel2] to [/share/MySmallDisk/channel2] ...
done.
- deleting excess directories from [/share/MySmallDisk/channel2] ...
done.
All the best
TS251A 8GB 2 x 3TB JBOD for LMS and loads of other stuff. 2 Hikvision DS-2CD2342WD-I
Firmware 4.4.3.1354 - Windows 11 + 2 x iPads
TS251A 8GB 2 x 3TB JBOD for LMS and loads of other stuff. 2 Hikvision DS-2CD2342WD-I
Firmware 4.4.3.1354 - Windows 11 + 2 x iPads
- OneCD
- Guru
- Posts: 12146
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
Re: Want to schedule delete files and folders on attached USB drive.
That's OK, no problem.sharper9 wrote:I would like to get it working.
Im just very aware of he great effort you are putting in.
That is how the directory structure appears on a Windows PC. On your NAS, it's slightly different.sharper9 wrote:This is the structure on MSD where the video files on resideI included this as I wondered if might be stopping the deletion of the directory on MSD?I:\channel1\2017-03-13\01.avi
Ah, this does indicate a problem. There are no log entries after 5am on Saturday. This seems to indicate that the archive script is not running. We did disable it around that time. A couple of days later, we should have switched it back on again.sharper9 wrote:Code: Select all
runtime: [Sat Apr 15 05:00:02 BST 2017] - moving excess directories from [/share/Recordings/record_nvr/channel2] to [/share/MySmallDisk/channel2] ... done. - deleting excess directories from [/share/MySmallDisk/channel2] ... done.
So, there are a couple of things to check:
- Please list the directories on your NAS:
Code: Select all
ls -dr1 /share/Recordings/record_nvr/channel1/*
- Please check your crontab file as per my previous post. Ensure it is loaded into memory afterwards with:
Code: Select all
crontab /etc/config/crontab && /etc/init.d/crond.sh restart
- Run this to check the list:
and please post it back here.
Code: Select all
crontab -l
- sharper9
- Know my way around
- Posts: 196
- Joined: Fri Jun 06, 2008 6:10 pm
Re: Want to schedule delete files and folders on attached USB drive.
I'll do this in 'my' morning!
Thx
Thx
All the best
TS251A 8GB 2 x 3TB JBOD for LMS and loads of other stuff. 2 Hikvision DS-2CD2342WD-I
Firmware 4.4.3.1354 - Windows 11 + 2 x iPads
TS251A 8GB 2 x 3TB JBOD for LMS and loads of other stuff. 2 Hikvision DS-2CD2342WD-I
Firmware 4.4.3.1354 - Windows 11 + 2 x iPads
- sharper9
- Know my way around
- Posts: 196
- Joined: Fri Jun 06, 2008 6:10 pm
Re: Want to schedule delete files and folders on attached USB drive.
Code: Select all
[~] # ls -dr1 /share/Recordings/record_nvr/channel1/*
/share/Recordings/record_nvr/channel1/2017-04-20/
/share/Recordings/record_nvr/channel1/2017-04-19/
/share/Recordings/record_nvr/channel1/2017-04-18/
/share/Recordings/record_nvr/channel1/2017-04-17/
/share/Recordings/record_nvr/channel1/2017-04-16/
/share/Recordings/record_nvr/channel1/2017-04-15/
/share/Recordings/record_nvr/channel1/2017-04-14/
/share/Recordings/record_nvr/channel1/2017-04-13/
/share/Recordings/record_nvr/channel1/2017-04-12/
/share/Recordings/record_nvr/channel1/2017-04-11/
/share/Recordings/record_nvr/channel1/2017-04-10/
This due to the stupid surveillance station software. It has two settings area to set the length to retain, one in the individual camera and another in the admin settings
Anyway both set NOW to 20 days BEFORE it overwrites the oldest!
Code: Select all
[~] # crontab -l
# m h dom m dow cmd
0 3 * * 0 /etc/init.d/idmap.sh dump
0 4 * * * /sbin/hwclock -s
0 3 * * * /sbin/vs_refresh
0 3 * * * /sbin/clean_reset_pwd
0-59/15 * * * * /etc/init.d/nss2_dusg.sh
30 7 * * * /sbin/clean_upload_file
0 2 * * * /sbin/qfstrim
0-59/10 * * * * /etc/init.d/storage_usage.sh
30 3 * * * /sbin/notice_log_tool -v -R
10 15 * * * /usr/bin/power_clean -c 2>/dev/null
10 0 * * * /etc/init.d/antivirus.sh scan 1
0 0 * * * /etc/init.d/antivirus.sh archive_log
08 0 */1 * * /etc/init.d/antivirus.sh update_db
* * * * * /mnt/ext/opt/netmgr/util/lock_timer.sh
35 7 * * * /sbin/qbox_util -c > /dev/null 2>/dev/null
19 * * * * /sbin/qddns_check 2>/dev/null
0 5 * * * /share/50014EE20BA4E444_DATA/.system/archive-old-stuff.sh >> /share/50014EE20BA4E444_DATA/.system/nvr-archiver.log
*/3 * * * * /etc/config/qsync_init.sh
4 3 * * 3 /etc/init.d/backup_conf.sh
All the best
TS251A 8GB 2 x 3TB JBOD for LMS and loads of other stuff. 2 Hikvision DS-2CD2342WD-I
Firmware 4.4.3.1354 - Windows 11 + 2 x iPads
TS251A 8GB 2 x 3TB JBOD for LMS and loads of other stuff. 2 Hikvision DS-2CD2342WD-I
Firmware 4.4.3.1354 - Windows 11 + 2 x iPads
- OneCD
- Guru
- Posts: 12146
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
Re: Want to schedule delete files and folders on attached USB drive.
Okiedoke, crontab looks good and you found why the directory list was being trimmed, so now we play the waiting game...sharper9 wrote:Anyway both set NOW to 20 days BEFORE it overwrites the oldest!
Check your USB drive again in a few days.
- sharper9
- Know my way around
- Posts: 196
- Joined: Fri Jun 06, 2008 6:10 pm
Re: Want to schedule delete files and folders on attached USB drive.
Update.
Things were starting to work re your script.
But as you know I was trying to the files on the nas to 20 day!!!
I tried to use the Surveillance Station UI to set the amount of days to keep but only managed to delete all but 4 FOUR of my current recording on the NAS!!!!
As of today I have five current recordings. But I'm going to have to wait for them to build up before your script will kick in.
Thats where we are at
Things were starting to work re your script.
But as you know I was trying to the files on the nas to 20 day!!!
I tried to use the Surveillance Station UI to set the amount of days to keep but only managed to delete all but 4 FOUR of my current recording on the NAS!!!!
As of today I have five current recordings. But I'm going to have to wait for them to build up before your script will kick in.
Thats where we are at
All the best
TS251A 8GB 2 x 3TB JBOD for LMS and loads of other stuff. 2 Hikvision DS-2CD2342WD-I
Firmware 4.4.3.1354 - Windows 11 + 2 x iPads
TS251A 8GB 2 x 3TB JBOD for LMS and loads of other stuff. 2 Hikvision DS-2CD2342WD-I
Firmware 4.4.3.1354 - Windows 11 + 2 x iPads
- OneCD
- Guru
- Posts: 12146
- Joined: Sun Aug 21, 2016 10:48 am
- Location: "... there, behind that sofa!"
Re: Want to schedule delete files and folders on attached USB drive.
No worries, let's see how it looks a couple of weeks from now.
- sharper9
- Know my way around
- Posts: 196
- Joined: Fri Jun 06, 2008 6:10 pm
Re: Want to schedule delete files and folders on attached USB drive.
Hi
I'm trying to turn off the crontab off with # to let the recording stack up on the nas HD. ATM moment the your crontab is moving them so I cant get above 13.
I put a # to stop it, but it looks wrong
I changed the amount of files to achieve to 21!!. I thought on the crontab.........(but can't see it now) as I could not get the NAS past the 11 day.
I think im getting confused ( to put it mildly)
I'm trying to turn off the crontab off with # to let the recording stack up on the nas HD. ATM moment the your crontab is moving them so I cant get above 13.
I put a # to stop it, but it looks wrong
Code: Select all
10 15 * * * /usr/bin/power_clean -c 2>/dev/null
19 * * * * /sbin/qddns_check 2>/dev/null
#0 5 * * * /share/50014EE20BA4E444_DATA/.system/archive-old-stuff.sh >>
/share/50014EE20BA4E444_DATA/.system/nvr-archiver.log
34 13 * * * /share/50014EE20BA4E444_DATA/.qpkg/QcloudSSLCertificate/bin/ssl_age$
4 3 * * 3 /etc/init.d/backup_conf.sh
10 0 * * * /etc/init.d/antivirus.sh scan 1
0 0 * * * /etc/init.d/antivirus.sh archive_log
42 0 */1 * * /etc/init.d/antivirus.sh update_db
* * * * * /mnt/ext/opt/netmgr/util/lock_timer.sh
35 7 * * * /sbin/qbox_util -c > /dev/null 2>/dev/null
38 13 * * * /share/50014EE20BA4E444_DATA/.qpkg/QcloudSSLCertificate/bin/ssl_age$
0 0 * * * /usr/local/medialibrary/bin/mymediadbcmd buildall 1>/dev/null 2>/dev/$
I think im getting confused ( to put it mildly)
All the best
TS251A 8GB 2 x 3TB JBOD for LMS and loads of other stuff. 2 Hikvision DS-2CD2342WD-I
Firmware 4.4.3.1354 - Windows 11 + 2 x iPads
TS251A 8GB 2 x 3TB JBOD for LMS and loads of other stuff. 2 Hikvision DS-2CD2342WD-I
Firmware 4.4.3.1354 - Windows 11 + 2 x iPads