##十. File transfer and log management in Linux
1: scp (remote copy command, complete copy):
2.rsync: (incremental backup, only copy what is not)
rsync can greatly reduce the time of repeated copying:
The 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
packaging command can greatly increase the transmission rate:
"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:
packaging and compression together; unpacking the compressed package:
4.journalctl command:
5. Use journald service to store logs permanently:
Permanently store the daily files on the hard disk:
rsyslog: log classification collection service;
6. Custom log collection path:
Store all types and levels of logs in /etc/rsyslog.conf in /var/log/westos (the target file will be created automatically):
7. Log synchronization and log collection format:
7-1: Turn on the log synchronization function in the rsyslog service:
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)
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:
8. Time setting in the system: