Command line options to clear Application Usage Data

Started by Nasapunk88

Nasapunk88

Command line options to clear Application Usage Data   14 August 2015, 06:21

Hello, I currently use Satellite internet, which sucks, and have a monthly limit with a 5 hour nightly Free Zone. I LOVE Networx so much for tracking my daily usage on all my computers and having the On-Peak, Off-Peak hours is perfect. The Application Usage tracking is a great feature to understand even further what is using the data, however, it would be even better if I was able to track it daily, or reset it daily, or to also follow the On-Peak/Off-Peak hours.

When I notice I have accidentally downloaded a bunch of data in the past hour, going to the Application Usage tab is useless if I forgot to clear all data since the previous Free Zone. (I get 10gigs per month and I can download over 15gigs during 1 night of Free Zone lol. It messes up the usage stats very much.)

Is there any Command Line Interface or API available that I can hook into for controlling Networx? Something to run a scheduled script that can clear the data. Any hidden feature or way to do this without manually using the mouse. The only other way I can think of is a script to exit Networx, edit the database file and then restart Networx.
Thanks!

Re: Command Line Options, Clear Application Usage Data   14 August 2015, 07:58

Quote

Nasapunk88

The Application Usage tracking is a great feature to understand what is using the bandwidth, however, it would be even better if I was able to track it daily, or reset it daily, or to also follow the On-Peak/Off-Peak hours.


If you want to reset only the Application statistics without affecting your other statistics, you can right click inside the App stats window and either "Delete" a single line at a time or "Clear All" App totals whenever you want to.

If you press the [Reset] button at the top you'll delete ALL stats, which is not what you appear to want.
nasapunk88

Re: Command Line Options, Clear Application Usage Data   14 August 2015, 17:08

Yeah luckily I finally figured out that was possible after searching the fourms, but now I would love to automate the process on a schedule. It's a pain to do that every morning.

Re: Command Line Options, Clear Application Usage Data   14 August 2015, 18:50

Then you might need to make an sqlite script and schedule it for "every morning". Check the site https://sqlite.org/sqlite.html for command line stuff, and good luck...

J

PS It may or may not be possible if Networx is running when the script starts to execute, Networx may lock the database to prevent the script, etc.
SoftPerfect Support forum - Andrew avatar image

Re: Command line options to clear Application Usage Data   14 August 2015, 23:39

Just download SQLite and launch it to execute something like DELETE FROM application every morning in your scheduled script.

Re: Command line options to clear Application Usage Data   15 August 2015, 02:57

Hi Andrew,

I tried and failed. I opened sqlitespy and created an .sql file containing:

OPEN networx.db
DELETE FROM application
CLOSE

My thinking was that
1) the database must be opened before
2) the table can be referenced and then
3) the database should be closed.
When I tried to Execute the .sql I got a message that there was an error close to "Open".

Can you please provide the details? I've searched the web and can't find anything.

Then the Scheduled Task requires a pointer to the program and another if there are optional arguments. What should the optional argument be?

Thanks,
J
SoftPerfect Support forum - Andrew avatar image

Re: Command line options to clear Application Usage Data   15 August 2015, 18:35

I am not sure how do that with SQLiteSpy, but here's how to it with the standard SQLite shell:
sqlite3.exe "c:\full\path\to\NetWorx.db" "DELETE FROM application"
Hope this helps.

Re: Command line options to clear Application Usage Data   15 August 2015, 22:18

Perfect! ok, yes, thumb up

I also set up an annual task to clear Usage.

Enter the first day of a year into a spreadsheet and format the cell as numeric with zero decimals, this number is used to define the prior records to be deleted.
Set up/modify the task to Run Once (but never expire so it can be used again next year) so that it runs
on 1 Jan 2016 run with date 1 Jan 2015 which is expressed as an integer 42005
on 1 Jan 2017 run with date 1 Jan 2016 which is expressed as an integer 42736 etc. etc.

I have things set up in custom locations because I run:
1) Installed instance for Application stats which is 'cleared' every day at 06:56 using your instructions
2) Portable instance for Usage for the last 2 years which is 'cleared' on the first day of a new year of all usage prior to one year ago.
For example the task will run on 1 Jan 2016 using the clause "DELETE FROM usage WHERE DAY < 42005" which will leave only usage for 2015.

Thanks Andrew, and I hope this helps anyone else that wants to 'clean the house' laugh

J
nasapunk88

Re: Command line options to clear Application Usage Data   16 August 2015, 16:29

This is exactly what I need! Thank you very much! Guess I could even get more creative now and extract and save each day's data to keep record. Being able to run direct sql commands on the database without requiring a restart of the program is pretty sweet. Allows for so many possibilities.

Re: Command line options to clear Application Usage Data   17 August 2015, 01:52

And Andrew,
You solved my issue in this thread.

Again, thanks very much,
J

Reply to this topic

Sometimes you can find a solution faster if you try the forum search, have a look at the knowledge base, or check the software user manual to see if your question has already been answered.

Our forum rules are simple:

  • Be polite.
  • Do not spam.
  • Write in English. If possible, check your spelling and grammar.

Author:

Email:

Subject

A brief and informative title for your message, approximately 4–8 words:

     

Spam prevention: please enter the following code in the input field below.

 **    **  **         ********   **     **  **    ** 
  **  **   **    **   **     **  **     **  **   **  
   ****    **    **   **     **  **     **  **  **   
    **     **    **   ********   **     **  *****    
    **     *********  **          **   **   **  **   
    **           **   **           ** **    **   **  
    **           **   **            ***     **    ** 

Message: