10. File transfer and log management in Linux

##十. File transfer and log management in Linux

1: scp (remote copy command, complete copy):
Insert picture description here
Insert picture description here

2.rsync: (incremental backup, only copy what is not)

Insert picture description hereInsert picture description here
rsync can greatly reduce the time of repeated copying:
Insert picture description hereThe disadvantages of rsync: the synchronization link of the file may be lost during the copying process (you can add "-l" to the parameter), file permissions ("-p"), and the user of the file ("o( own), g(group)"), file time ("-t"), character device, etc.;

3. File archive compression: the
Insert picture description here packaging command can greatly increase the transmission rate:
Insert picture description here
Insert picture description here"tar -P" means that the "/"
packaging command can only reduce the number of files without deleting the root when packaging and unpacking, but cannot reduce the file size;

File compression and decompression:
Insert picture description here
packaging and compression together; unpacking the compressed package:
Insert picture description here

4.journalctl command:

Insert picture description here
Insert picture description here
Insert picture description here

5. Use journald service to store logs permanently:

Insert picture description here
Permanently store the daily files on the hard disk:
Insert picture description here
rsyslog: log classification collection service;

6. Custom log collection path:
Insert picture description here

Store all types and levels of logs in /etc/rsyslog.conf in /var/log/westos (the target file will be created automatically):
Insert picture description here

Insert picture description here

7. Log synchronization and log collection format:
7-1: Turn on the log synchronization function in the rsyslog service:
Insert picture description here
7-2: After saving the configuration file, restart the rsyslog service, and set the ip address to be synchronized in the synchronized target host: ( @ Means udp transmission, @@ means tcp transmission)
Insert picture description here

7-3: Log collection format:
As shown in the figure: it means that all log files are renamed to the hahafaomat format set by themselves:
Insert picture description here

8. Time setting in the system:
Insert picture description hereInsert picture description here

Guess you like

Origin blog.csdn.net/lb1331/article/details/109503902