Don't know how many times the file has been deleted
Especially on Linux systems, sometimes the delete command is executed, sometimes the synchronization command is executed, the file is gone
Let's start to set the method to prevent file deletion under Linux system. . .
The practical method is the
chattr command that comes with the Linux system.
chattr configuration, in case some files are accidentally deleted. . . First understand some
chattr common commands
-R recursively change the attributes of a file, including any subfolders and any files below it
-V version information
-v set the version number of the file
"+ File Attributes" Set file attributes
"-File Attribute" Cancel File Attribute
"= File attribute" This file has this attribute only
a File can only be added, modified, and cannot be deleted
c folder add compressed files
s Safe delete
u cannot be deleted
chattr -V -R + a filename
The setting file can only be recursively added, modified, and cannot be deleted, and the execution process is displayed.
chattr -V -R -a filename