rtl-sdr-scanner-cpp icon indicating copy to clipboard operation
rtl-sdr-scanner-cpp copied to clipboard

Pruning spectrograms

Open great9 opened this issue 2 years ago • 11 comments

Is there a way to automatically prune spectrograms that are older than x hours or x days?

great9 avatar Feb 26 '23 13:02 great9

similar question for recording?

algorni avatar Feb 27 '23 14:02 algorni

similar question for recording?

Recordings should have an option to keep a recording. For example checkbox "lock recording"

great9 avatar Feb 27 '23 14:02 great9

There is a mechanism to delete recent transmissions over 10 GB. A similar mechanism is for spectrograms.

You can change the size of the quota in the docker-compose.yml.

Change line:

command: python3 manage.py runscript mqtt_reader

to

command: python3 manage.py runscript mqtt_reader sdr-broker 1883 admin password 10 10

Where two last digits mean size in GB of transmissions and spectrograms.

Hope it helps you.

shajen avatar Feb 28 '23 20:02 shajen

That's the docker volume mechanism. Why not implement this functionality as a cronjob ?

On Tue, Feb 28, 2023, 21:57 shajen @.***> wrote:

There is a mechanism to delete recent transmissions over 10 GB. A similar mechanism is for spectrograms.

You can change the size of the quota in the docker-compose.yml.

Change line:

command: python3 manage.py runscript mqtt_reader

to

command: python3 manage.py runscript mqtt_reader sdr-broker 1883 admin password 10 10

Where two last digits mean size in GB of transmissions and spectrograms.

Hope it helps you.

— Reply to this email directly, view it on GitHub https://github.com/shajen/rtl-sdr-scanner-cpp/issues/57#issuecomment-1448902813, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKLQHDTAKQXOXP6FG2SQWLWZZREFANCNFSM6AAAAAAVIOZOQY . You are receiving this because you authored the thread.Message ID: @.***>

great9 avatar Feb 28 '23 21:02 great9

What do you mean? Native cronjob on host machine?

It's not good idea because everyone have to configure it separately in his OS. Docker version works out of the box without any changes in host os. Moreover, it's hard to access django's files in docker directly from the host OS.

shajen avatar Mar 01 '23 18:03 shajen

cronjob as in a script that deletes spectrograms and recordings from the docker volumes. it can work as a docker cronjob, can be fired off by django not the os itself

great9 avatar Mar 04 '23 15:03 great9

to

command: python3 manage.py runscript mqtt_reader sdr-broker 1883 admin password 10 10

Hi i try to extend storage limit to temporary skip issue #60 , in some reason container fail to start with this error:

rtl-sdr-scanner-cpp-sdr-monitor-reader-1  | CommandError: An error has occurred running scripts. See errors above.
rtl-sdr-scanner-cpp-sdr-monitor-reader-1  | timezone: UTC
rtl-sdr-scanner-cpp-sdr-monitor-reader-1  | No (valid) module for script 'sdr-broker' found
rtl-sdr-scanner-cpp-sdr-monitor-reader-1  | No (valid) module for script '1883' found
rtl-sdr-scanner-cpp-sdr-monitor-reader-1  | No (valid) module for script 'admin' found
rtl-sdr-scanner-cpp-sdr-monitor-reader-1  | No (valid) module for script 'password' found
rtl-sdr-scanner-cpp-sdr-monitor-reader-1  | No (valid) module for script '40' found
rtl-sdr-scanner-cpp-sdr-monitor-reader-1  | No (valid) module for script '40' found
rtl-sdr-scanner-cpp-sdr-monitor-reader-1  | Try running with a higher verbosity level like: -v2 or -v3
rtl-sdr-scanner-cpp-sdr-monitor-reader-1 exited with code 0

In docker-compose.yml i put:

command: python3 manage.py runscript mqtt_reader sdr-broker 1883 admin password 40 40

instead of

command: python3 manage.py runscript mqtt_reader

Can you tell please what i doing wrong?

upya4ko avatar Mar 04 '23 15:03 upya4ko

cronjob as in a script that deletes spectrograms and recordings from the docker volumes. it can work as a docker cronjob, can be fired off by django not the os itself

I know what is a cronjob. How do you imagine deleting recordings using cronjob? To delete recordings you have to delete some data in db, not only files on disk.

Can you tell please what i doing wrong?

My mistake. The correct command is:

python3 manage.py runscript mqtt_reader --script-args sdr-broker 1883 admin password 40 40

shajen avatar Mar 04 '23 20:03 shajen

I know what is a cronjob. How do you imagine deleting recordings using cronjob? To delete recordings you have to delete some data in db, not only files on disk.

so why deleting db entries from django which already has access to the db is a problem? maybe im not following, I haven't looked at that code

great9 avatar Mar 04 '23 20:03 great9

is there also a way to lower down the logs level of the manage.py script by command line?

algorni avatar Mar 06 '23 11:03 algorni