I.in Windows


1. Create truncate.bat file with content 

cd %APPDATA%\smartcash
echo. > debug.log 


or you can used the file in attachment 


2. Scheduled task to run truncate.bat daily


To open Task Scheduler on Windows 10:

Way 1: Open it in the Start Menu.

Click the lower-left Start button, enter schedule in the empty box and select Schedule tasks from the results.

Way 2: Turn on Task Scheduler via Search.

Tap the Search button on the taskbar, type schedule in the blank box and choose Schedule tasks.

Way 3: Open it in the Control Panel.

Step 1: Access Control Panel.

Step 2: Find and tap Schedule tasks in System and Security.

Way 4: Open Task Scheduler in the Computer Management.

Step 1: Open Computer Management.

Step 2: Click Task Scheduler on the left.




Choose truncate.bat




II. In VPS

This step is to prevent the debug.log from getting too large.

  1. Connect to your VPS with root credentials and create a directory for the cronjob script (if it not already exists):
    • mkdir smartnode 
    • cd ~/smartnode/
  2. Download the appropriate script (taken from the SmartNode Bash installer by msg768):
    • wget https://raw.githubusercontent.com/SmartCash/smartnode/master/clearlog.sh
  3. Give execute permission to the cron script:
    • chmod 0700 ./clearlog.sh
  4. Open crontabs with crontab -e and add the following line to it:0 0 */2 * * ~/smartnode/clearlog.sh
    • crontab -e
    • 0 0 */2 * * ~/smartnode/clearlog.sh
  5. Apply the cronjob by reloading with /etc/init.d/cron reload or service cron reload
    • /etc/init.d/cron reload
    • service cron reload