2018-03-28 Linux Learning

Source: Internet
Author: User
Tags system log rsync

10.32 rsync via service sync on

Rsyncd.conf Sample Example
port=873
Log File=/var/log/rsync.log
PID File=/var/run/rsync.pid
address=192.168.104.160
[Test]
Path=/tmp/rsync
Use Chroot=true
Max Connections=4
Read Only=no
List=true
Uid=root
Gid=root
#auth Users=test
#sectets file=/etc/rsyncd.passwd
Hosts allow=192.168.104.165

    [[email protected] ~]# vi/etc/rsyncd.conf [[email protected] ~]# rsync--daemon [[Email protect        Ed] ~]# PS Aux|grep rsync root 1380 0.0 0.0 114652 524? Ss 05:37 0:00 rsync--daemon root 1382 0.0 0.0 112676 984 pts/0 s+ 05:37 0:00 grep--color=auto RS Ync [[email protected] ~]# mkdir/tmp/rsync [[email protected] ~]# chmod 777/tmp/rsync [[EMAIL PR] Otected] ~]# rsync-avp/tmp/aming.txt 192.168.104.160::test/aming-02.txt rsync:failed to connect to 192.168.104.160 ( 192.168.104.160): No route to host (113) Rsync error:error in socket IO (code ten) at CLIENTSERVER.C (122) [sender=3.0.9 ] [[email protected] ~]# systemctl stop firewalld.service [[email protected] ~]# systemctl stop FIREWALLD.    service [[email protected] ~]# telnet 192.168.104.160 873 Trying 192.168.104.160 ...    Connected to 192.168.104.160.    Escape character is ' ^] '. @RSYNCD: 30.0 [[Email pRotected] ~]# rsync-avp/tmp/aming.txt 192.168.104.160::test/aming-02.txt sending incremental file list Aming.txt     1054 100% 0.00kb/s 0:00:00 (xfer#1, to-check=0/1) sent 1127 bytes received bytes 2308.00 bytes/sec    Total size was 1054 speedup is 0.91rsyncd.conf configuration file in detail port: Specifies on which port the RSYNCD service is started, and the default is Port 873.    Log file: Specify the log files PID file: Specify the PID files, the role of this file design service start, stop and other process management operations. 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 not true, and if you have a soft link file in your data, Amin recommends that you set it to false.        [[email protected] ~]# killall rsync [[email protected] ~]# PS aux|grep rsync PS aux|grep rsync Root 2533 0.0 0.0 112676 984 pts/0 s+ 07:11 0:00 grep--color=auto rsync [[Email protect Ed] ~]# rsync--daemon [[email protected] ~]# PS Aux|grep rsync root 2535 0.0 0.0 114652 524? Ss 07:11 0:00 rsync--daemon root 2537 0.0 0.0 112676 984 pts/0 r+ 07:11 0:00 grep--color=aut o rsync [[email protected] ~]# rsync-avlp--port 8730 192.168.104.160::test//tmp/test/receiving incr    Emental file list created directory/tmp/test./aming-02.txt 1054 100% 1.01mb/s 0:00:00 (xfer#1, TO-CHECK=0/2) sent bytes received 1178 bytes 817.33 bytes/sec total size is 1054 SPE Edup is 0.86

10.33 Rsync is synchronized through the service

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 as 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 apply to password validation if they are not specified. Note that the permission to change the password file must be 600. Format: User name: Password hosts allow: The host that is allowed to connect to the module, can be IP or network segment, if it is multiple, in the middle with a space separated. 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/--passwd-file=/etc/pass where/etc/pass content is a password, the permission is changed to 600list=true [[email protected] ~]# rsync--po        rt=8730 192.168.104.160:: Test [[email protected] ~]# vi/etc/rsyncd.conf auth users=test Sectets file=/etc/rsyncd.passwd//Remove comments [[email protected] ~]# vi/etc/rsyncd.passwd test:aming/ /add [[email protected] ~]# chmod 600/etc/rsyncd.passwd [[email protected] ~]# vi/etc/rsync_pass. TXT aming//write-only password [[email protected] ~]# chmod 600/etc/rsync_pass.tXT ##### 

10.34 Linux System log

/var/log/messages/etc/logrotate.conf Log cut Profile reference HTTPS://MY.OSCHINA.NET/U/2000675/BLOG/908189DMESG command ( Hardware problems are basically here to see the error message)/VAR/LOG/DMESG log Last command, called the file is the/VAR/LOG/WTMPLASTB command to view the user failed to log in, the corresponding file is/var/log/btmp/var/log/ secure [[email protected] ~]# cat/etc/logrotate.conf # see ' Man logrotate ' for details # rotate log files     Weekly Weekly # Keep 4 weeks worth of backlogs rotate 4 # Create new (empty) log files after rotating old ones Create # Use date as a suffix of the rotated file Dateext # Uncomment this if you want your log files Compres Sed #compress # RPM Packages drop log rotation information into the This directory INCLUDE/ETC/LOGROTATE.D # no P        Ackages own wtmp and btmp--we ' ll rotate them here/var/log/wtmp {monthly Create 0664 root utmp MinSize 1M rotate 1}/var/log/btmp {Missingok monthly create 0600 root utmp rot Ate 1} # System-specific logs may also bE configured here. [[email protected] ~]# Cat/etc/logrotate.d/syslog/var/log/cron/var/log/maillog/var/log/messages/var /log/secure/var/log/spooler {Missingok sharedscripts postrotate/bin/kill-hup ' cat/v Ar/run/syslogd.pid 2>/dev/null ' 2>/dev/null | |   True Endscript} [[email protected] ~]# last root pts/0 192.168.104.1 Sun Mar 11 22:15 Still logged in reboot system boot 3.10.0-693.17.1. Sun Mar 22:14-04:25 (06:10) root pts/0 192.168.104.1 Sun Mar 05:17-down (02:11) r Eboot system Boot 3.10.0-693.17.1. Sun Mar 05:15-07:29 (02:13) root pts/0 192.168.104.1 Sat Mar 03:42-down (03:29) r Eboot system Boot 3.10.0-693.17.1. Sat Mar 10 03:35-07:12 (03:37)

10.35 Screen Tool

为了不让一个任务中断nohup command &screen 是一个虚拟终端yum install -y screenscreen 直接回车就进入了虚拟终端ctrl+a 组合键再按d退出虚拟终端,但不是结束screen -ls  查看虚拟终端列表screen -r id 进入指定的终端screen -S amingscreen -r aming

2018-03-28 Linux Learning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.