大网数据广告活动
服务器运维问答

rsync taking 100% of CPU and hours to complete

· 52CE 我爱测

So I have a pretty simple backup script that runs as a cron job every night and it is: rsync -azhv /company/shared_files/ /mnt/ext_drive/backups/shared_files/company_share_backup_"`date +\%Y-\%m-\%d`" And previously the size of t…

问题原文

原帖链接 · clifgray · CC BY-SA 3.0

So I have a pretty simple backup script that runs as a cron job every night and it is:

rsync -azhv /company/shared_files/ /mnt/ext_drive/backups/shared_files/company_share_backup_"`date +\%Y-\%m-\%d`"

And previously the size of the backup was around 20 gigs and it ran in around ten minutes but as of two days ago it is 80 gigs and it takes 6+ hours to run. What could have gone wonky?

My general procedure is to keep each backup for 7 days and then keep the backup from Sunday each week to save space so ideally I would like to do a separate rsync for each day as opposed to doing rsync in its more natural fashion of just updating the files in a backup that have changed.

Additional Details

I'm running Debian Wheezy with a 2TB hard drive and 16G of memory and transferring these files from my Debian server to a WD My Passport Ultra with 2TB.

已采纳解答

原帖链接 · ewwhite · CC BY-SA 3.0

There are a few things you can do there. You don't need the -z flag to rsync for a local copy. Compression is not used for transfers that aren't remote.

You can optimize the rsync a bit better for small files and the type of changes with other options like -W (to transfer whole files without the prescan).

Also, shouldn't you be deleting files on the destination?

More details on the actual OS you're using, the disk capabilities and the backup target could help focus the solution a bit better.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2014-10-24)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。