Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the specific method of Linux system file backup?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article is to share with you about the specific method of Linux system file backup, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

How to backup files in Linux system?

# the specified user in work (may not be specified as 0) uid = 0 gid = 0 # is equivalent to a black hole. Error location use chroot = no # how many clients simultaneously transfer files max connections = 200 # timeout timeout = 300 # process number file pid file = / var/run/rsyncd.pid # log file lock file = / var/run/rsync.lock # log file log file = / var/log/rsyncd.log # module starts # module name is random (can be multiple) [backup] # directories to be backed up path = / backup # indicates error ignoring error ignore errors # indicates that network permissions are writable (local control is really writable) read only = false # here set IP or let not synchronize list = false # specify allowed network segment hosts allow = 192.168.1.0 Universe 24 # reject the address of the link Click to indicate that there is no rejected link. Hosts deny = 0.0.0.0 hosts deny 32 # Don't move (default) # Virtual user auth users = rsync_backup # password file for virtual user secrets file = / etc/rsync.password II, backup server configuration password file for virtual user

[root@slave /] # echo "rsync_backup:123456" > / etc/rsync.password [root@slave /] # cat / etc/rsync.password rsync_backup:123456 # Note: rsync_backup is a virtual user, and 123456 raises the weight of the password file for this virtual user's password [root@inotify-slave /] # chmod / etc/rsync.password # to increase security. 3. Configure the virtual user password on the main server and test it.

[root@master ~] # echo "123456" > / etc/rsync.password [root@master ~] # cat / etc/rsync.password 123456 # Note: just write the password here, remember. [root@master ~] # chmod # ll / etc/rsync.password-rw- 1 root root 7 April 22 14:32 / etc/rsync.password [root@master ~] # echo "hello itstyle" > test.txt [root@master ~] # cat test.txt hello itstyle [root@inotify ~] # rsync-avz test.txt rsync_backup@192.168.1.130::backup-password-file=/etc/rsync.password sending Incremental file list test.txt sent 82 bytes received 27 bytes 72.67 bytes/sec total size is 13 speedup is 0.124, Write a script

Vi rsync_push.sh

#! / bin/bash rsync-az / home/tomcat8 rsync_backup@192.168.1.130::backup-- the above is the specific method of backing up Linux system files. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report