How to stop truncate command safely

I am trying to empty my syslog.1 file which was flooded with some messages and has the size of 77 GB. I did

sudo truncate -s 0 /var/log/syslog.1

but the command is taking more than 2 hours to return. Is it safe to stop it by Ctrl-C or by the kill command? I am afraid that these methods may cause inconsistency in the file system. Is there a better way?

The system is Ubuntu 16.04. The root partition where /var/log/syslog.1 sits is almost full due to the sudden increase in size of this file as well as /var/log/syslog and /var/log/kern.log. The latter files are still continuing to grow, but the command line is still responsive.

Go to Source
Author: norio

Is there a program that emulate folder/file structure for databases in ubuntu?

I have a database that has about 500,000 files. They’re text files, and the folder structure divides them into groups of about 40 files each. I chose this structure because I wanted to be able to use a text editor to view each of the files. But I’d like to reduce the number of files I have, so backups go faster.

I’m looking for a program (or a database structure) that emulates a standard file structure, but is actually one file. My ideal structure would be to have something like a few .zip folders, but allow the files and folders in the .zip to be read, accessed, and written by file references from python and and a text editor (e.g., with a simple reference like “nano dataGroup1.zip/folderA/file.txt”).

Is there such a program?

Go to Source
Author: quark