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.
- Connect to your VPS with root credentials and create a directory for the cronjob script (if it not already exists):
mkdir smartnode
cd ~/smartnode/
- Download the appropriate script (taken from the SmartNode Bash installer by msg768):
wget https://raw.githubusercontent.com/SmartCash/smartnode/master/clearlog.sh
- Give execute permission to the cron script:
chmod 0700 ./clearlog.sh
- 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
- Apply the cronjob by reloading with
/etc/init.d/cron reload
orservice cron reload
/etc/init.d/cron reload
service cron reload