Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
cuzv
mark
Repository navigation
Code
Issues
3
(3)
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
mark
/
linux
/
vBirdScript
/
backupwk
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
executable file
·
50 lines (46 loc) · 1.46 KB
master
Breadcrumbs
mark
/
linux
/
vBirdScript
/
backupwk
Copy path
Top
File metadata and controls
Code
Blame
executable file
·
50 lines (46 loc) · 1.46 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# ====================================================================
# 使用者参数输入位置:
# basedir=你用来储存此脚本所预计备份的数据之目录(请独立文件系统)
basedir=/backup/weekly <==您只要改这里就好了!
# ====================================================================
# 底下请不要修改了!用默认值即可!
PATH=/bin:/usr/bin:/sbin:/usr/sbin; export PATH
export LANG=C
# 配置要备份的服务的配置档,以及备份的目录
named=$basedir/named
postfixd=$basedir/postfix
vsftpd=$basedir/vsftp
sshd=$basedir/ssh
sambad=$basedir/samba
wwwd=$basedir/www
others=$basedir/others
userinfod=$basedir/userinfo
# 判断目录是否存在,若不存在则予以创建。
for dirs in $named $postfixd $vsftpd $sshd $sambad $wwwd $others $userinfod
do
[ ! -d "$dirs" ] && mkdir -p $dirs
done
# 1. 将系统主要的服务之配置档分别备份下来,同时也备份 /etc 全部。
cp -a /var/named/chroot/{etc,var} $named
cp -a /etc/postfix /etc/dovecot.conf $postfixd
cp -a /etc/vsftpd/* $vsftpd
cp -a /etc/ssh/* $sshd
cp -a /etc/samba/* $sambad
cp -a /etc/{my.cnf,php.ini,httpd} $wwwd
cd /var/lib
tar -jpc -f $wwwd/mysql.tar.bz2 mysql
cd /var/www
tar -jpc -f $wwwd/html.tar.bz2 html cgi-bin
cd /
tar -jpc -f $others/etc.tar.bz2 etc
cd /usr/
tar -jpc -f $others/local.tar.bz2 local
# 2. 关於使用者参数方面
cp -a /etc/{passwd,shadow,group} $userinfod
cd /var/spool
tar -jpc -f $userinfod/mail.tar.bz2 mail
cd /
tar -jpc -f $userinfod/home.tar.bz2 home
cd /var/spool
tar -jpc -f $userinfod/cron.tar.bz2 cron at
You can’t perform that action at this time.