first, RYSNC through the service synchronization
Rsync is synchronized by service
To edit a configuration file/etc/rsyncd.conf
Start Service rsync--daemon
Format: Rsync-av test1/192.168.127.133::module/dir/
vim /etc/rsyncd.conf
Rsyncd.conf Sample Example
port=873log file=/var/log/rsync.logpid file=/var/run/rsyncd.pidaddress=192.168.127.133[test]path=/tmprsyncuse chroot=truemax connections=4read only=nolist=trueuid=rootgid=rootauth users=testsecrets file=/etc/rsyncd.passwdhosts allow=192.168.127.133 1.1.1.1 2.2.2.2 192.168.127.0/24
First note the two lines of the code in the picture, easy to test
rsync --daemon
telnet 192.168.127.133 873 //检查端口通不通
(This step is tested on another machine, if it does not pass, Systemctl stop FIREWALLD shuts down the firewall)
CTRL +] and then enter quit to exit Telnet
rsyncd.conf configuration file
Port: Specifies on which port the RSYNCD service is started, and the default is Port 873.
Log file: Specifies the log files.
PID File: Specifies the PID files that are involved in process management operations such as starting and stopping services.
Address: Specifies the IP to start the RSYNCD service. If your machine has multiple IPs, you can specify that one of the boot RSYNCD services, if not specified, is started on all IPs by default.
[]: Specifies the module name, inside the content customization.
Path: Specifies the path where the data is stored.
Use chroot True|false: Represents the first chroot to the directory specified by the path parameter before transferring the file. The reason for this is to implement additional security protections, but the disadvantage is that you need to roots permissions, and you cannot back up the directory files that point to external symbolic connections. By default, the Chroot value is true, and it is recommended that you set it to False if there are soft connection files in your data.
Max connections: Specifies the maximum number of connections, which defaults to 0, which means there is no limit.
Read Only Ture|false: If true, you cannot upload to the path specified by the module.
List: Indicates whether the module is listed when the user queries the available modules on the server, set to True is listed, and false is hidden.
Uid/gid: Specifies which user/group is transferred when the file is transferred.
Auth Users: Specifies the user name to use when transferring.
Secrets File: Specifies the password files, which, together with the parameters above, do not use password authentication if they are not specified. Note that the password file's permissions must be 600. Format: Username: Password
hosts allow: Represents the host that is allowed to connect to the module, either IP or network segment, if multiple, separated by a space.
When the Auth users and Secrets file are set, the client Connection server also needs the user name password, if you want to bring the password on the command line, you can set a password file
Rsync-avl [email protected]:: test/test1//tmp/test8/--password-file=/etc/pass
where/etc/pass content is a password, the permission is changed to-
The following test synchronizes files through the service
First create a/tmp/rsync folder on the 133 server and create a few files at any
Then synchronize the files with the command on the 134 server
rsync -avP /tmp/test/qweqwweqwe.txt 192.168.127.133::test/9.txt rsync -avP 192.168.127.133::test/ /tmp/test
The password file format for the machine (133) where the service is located is the user name: password
Only write the password in the password file in the machine (134) using the service
Second, Linux system log
/var/log/messages//System log file
/etc/logrotate.conf Log cutting profile (automatic log cutting)
, the system is cut once a week by default, save four, by the date suffix, and create a new log
Reference https://my.oschina.net/u/2000675/blog/908189
- DMESG command//system hardware-related logs, no files, only in memory
-C Empty the hardware log
- /VAR/LOG/DMESG//System boot log, independent of DMESG
- Last command, call the file/var/log/wtmp//View the correct login history
- LASTB Command View login failed user, corresponding file/var/log/btmp//view wrong login history (above two files cannot be directly cat, can only be viewed by relevant commands)
- /var/log/secure//Security-related logs
Third, screen tools
In order not to accidentally interrupt a task
Nohup Command &
Screen is a virtual terminal
Yum install-y Screen
Screen directly enter into the virtual terminal
Ctral a combo key and press D to exit the virtual terminal, but not the end
End With exit
Screen-ls viewing the virtual terminal list
Screen-r ID into the specified terminal
Screen-s Chen//custom screen name
Screen-r Chen//Enter screen
36.RYSNC through service synchronization, Linux system logs, screen tools