简体   繁体   English

完整的每周备份和每日增量备份

[英]Full Weekly Backup & Daily Incremental Backup

I have Linux Centos 6.5, and I have tried different backup scripts, but I have failed each time.我有 Linux Centos 6.5,我尝试过不同的备份脚本,但每次都失败。 I only have a small amount of experience with Linux, I've only used it to set up a server etc. so I don't know how to do proper backups.我对Linux只有少量经验,我只用它来设置服务器等,所以我不知道如何进行适当的备份。 I have a 100GB FTP server connected to my Linux server that I can use for backups.我有一个 100GB 的 FTP 服务器连接到我的 Linux 服务器,我可以将其用于备份。

I need a script that takes a weekly backup and also a daily incremental backup.我需要一个需要每周备份和每日增量备份的脚本。 I only need to backup certain directories, eg /home, /etc and so on.我只需要备份某些目录,例如/home、/etc 等。 It should also automatically execute every week/day and take a backup and put that backup on the FTP server.它还应该每周/每天自动执行并进行备份并将该备份放在 FTP 服务器上。

Is there anyone who has a proper and working script for this?有没有人为此提供适当且有效的脚本?

Assuming that you have installed Centos, you obviously have crond tool.假设你已经安装了 Centos,你显然已经有了crond工具。 Put your routines into the cron, and it will execute any script at the specified time:将您的例程放入 cron,它会在指定时间执行任何脚本:

su #login as root
crontab -e

This will run the FTP upload every day at hh:mm :这将每天在hh:mm运行 FTP 上传:

mm hh * * * curl --upload-file testfile.zip ftp://user:password@ftp.domain.com/

But i find it more useful to use direct filesystem access for creating backups (you need to configure ssh public key access before):但我发现使用直接文件系统访问来创建备份更有用(您需要先配置 ssh 公钥访问):

mm hh * * day_of_week_number rsync -avh -e --updates --delete /source remote.host:/dest

在 crontab 中添加以下介绍将有助于每周备份 Linux 分区。

mm hh * * dow rsync -avh -e --updates --delete /source /destination

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM