Linux系统之备份数据

Linux系统运维脚本:备份mysql数据库,并删除旧的数据库备份文件(保留最新的数据库备份) bash脚本, 利用mysqldump命令备份数据库,然后再进行压缩,以便节省磁盘空间。 将备份的SQL文件压缩为ZIP或者tar文件。如果备份过程中出现问题或压缩文件为空,则发送邮件通知。定期删除超过15天的旧备份文件。 阅读详情

System Backup and Recovery

Rsync

Rsync is the directory backup and transfer tool for Linux. It is installed by default in Ubuntu. It can provide any type of backup, and options are extensive. Several GUI frontends for Rsync are listed here.

GRsync

GRsync is a GTK-based GUI front-end for Rsync. Install:

sudo apt-get install grsync

Bacula

Bacula is the most widely-used GTK-based open source (GPL-licensed) network backup utility that is used in both server and desktop installations. A catalogue of backups can be maintained using MySQL, PostgreSQL, or SQLite. For more info see the Ubuntu documentation. Both text-based and GUI frontends are available. Install the MySQL version:

sudo apt-get install bacula

SBackup

SBackup is a simple backup and restore utility for the GTK-desktop. Install:

sudo apt-get install sbackup

Keep (Backup and Recovery)

Keep is a QT/KDE based backup utility used in previous versions of Ubuntu. It is no longer maintained and is not included in Ubuntu by default. Install:

sudo apt-get install keep

Run:

  • Menu -> Applications -> System Tools -> Keep (Backup System)
  • Backup:
Click "Add a Directory to Backup"
Select directories you wish to backup
Select a location to place the backup
Set how often you wish the backups to take place, and how long to keep them
Click "Backup Now"
Select the directory groups you wish to backup.
  • Recover:
Click "Restore a Backup"
Select the directory groups you wish to restore.

Partimage (Partition backup)

Partimage is a free open-source utility to back up an entire partition into an .iso image. It can be used across a network, as well. Install and run:

sudo apt-get install partimage
sudo partimage

Partimage cannot be used from within the partition you wish to backup. You will either have to run it from a different partition or from a LiveCD that contains it. (A serious limitation of Partimage is its inability to backup/restore split image files to/from multiple media (e.g. spanned DVDs/CDs), limiting its usefulness as an inexpensive cloning and distribution solution. Partition image backup/restoration must be to/from a single hard drive, large capacity USB stick, or networked storage space.)

cp

An entire partition's filesystem can easily be copied to another partition using the cp -a command. (However, this cannot be done for the partition of a filesystem that is running. Use the (K)Ubuntu LiveCD to copy partitions when necessary.) Obviously the destination partition should be as large or larger than the source partition, and while not necessary, probably is best if both partitions are of the same filesystem type (e.g. ext4). Use GParted to create or manipulate the destination partition, if necessary. To copy the entire filesystem, for example, from the ext4 partition /dev/sda6 into the ext4 partition at/dev/sda7, mount both partitions:

sudo mkdir /media/partsda6
sudo mkdir /media/partsda7
sudo mount /dev/sda6 -t ext4 /media/partsda6
sudo mount /dev/sda7 -t ext4 /media/partsda7

Then merely copy the contents from one partition to the other:

sudo cp -a /media/partsda6/* /media/partsda7
  • Of course, once the partition's filesystem is copied, a bootmanager (Grub2 or Grub Legacy) will have to be updated/reconfigured to recognize the new partition's OS in order to enable it to boot. Also, the /etc/fstab file of the new partition's filesystem may need to be edited (in regards to the UUIDs of the various partitions), to prevent conflicts. To determine the UUIDs of all current partitions on a hard drive:
sudo blkid

Edit fstab so that the UUIDs are correctly reflected there.

  • To confirm that the file copy has completed, the Linux command du (also see these tips) can be used to calculate the disk usage for both the source and destination folders in order to compare the values (to ensure that they are the same). For example, the values should be the same for both partitions after copying has completed:
sudo du /media/partsda6
sudo du /media/partsda7

dd

dd is a *nix command that enables the copying of files or an entire disk using a single command. Parameters must be precisely specified to avoid risk of accidentally erasing data. See these brief instructions or these instructions for detailed options. You cannot copy a hard drive that contains the operating system you are currently running. Instead, boot into a LiveCD and run the dd command that way. An example command to copy Hard drive X to Hard drive Y is:

dd if=/dev/hdx of=/dev/hdy
  • ddrescue is a variation of the dd command that allows working with potentially corrupted datasets, partitions, or hard drives.

FSArchiver (Filesystem Archiver)

FSArchiver is a utility to backup the filesystem by files (instead of by partition blocks). A filesystem backed up in this way can be moved to a different sized partition or another disk filesystem altogether (e.g. from ext3 to ext4). Backups can be split and stored on (and restored from) spanned media (e.g. multiple DVDs/CDs). It is included in the System Rescue CD. Install:

sudo apt-get install fsarchiver

System Rescue and Cloning Utilities

System Rescue CD

SystemRescueCD is a LiveCD that includes important utilities such as GParted, Partimage, ddrescue, Rsync, andFSArchiver. Several of these utilities cannot be used from within a running partition, so using them from a LiveCD is often necessary. Download and burn the LiveCD from the website.

Clonezilla

Clonezilla allows the backup or duplication of a partition for a single machine or for multiple machines over a network. (It is similar to Norton Ghost.) It includes Partimage, partclone, and other utilities. It is available as a LiveCD which can then be burned. (A serious limitation of Clonezilla is its inability to backup/restore split image files to/from multiple media (e.g. spanned DVDs/CDs), limiting its usefulness as an inexpensive cloning and distribution solution. Partition image backup/restoration must be to/from a single hard drive, large capacity USB stick, or networked storage space.)

Disk Imaging software

  • G4U is a utility to image a disk bit by bit.
  • G4L is a utility to image a disk bit by bit. It includes a GUI interface.

Ubuntu Customization Kit

sudo apt-get install uck

Remastering software

Debian and (K)Ubuntu Linux operating systems can be "remastered" and customized (using one of a number of utilities) for re-distribution. (See this Wikipedia list.) This enables an organization to pre-load desired applications and customizations for distribution among its members, while preserving the intrinsic architecture and function of (K)Ubuntu. The customized (K)Ubuntu OS can then be distributed on a CD or on a USB flashdrive. Users are then free to further customize the OS, or even to revert back to the original default (K)Ubuntu settings. Also see the Ubuntu wiki.

  • oem-config-gtk
sudo apt-get install oem-config-gtk

Run (K)Ubuntu LiveCD from a USB pendrive

The (K)Ubuntu LiveCD can be installed on and run from a USB pendrive. Settings can be "persistently" saved (but the LiveCD kernel modules can not be upgraded). Programs can be installed and run, however, and files saved to the USB drive. (The installed programs will remain installed). A (K)Ubuntu Live CD is needed to do the installation. For additional info, see the Ubuntu Official documentation, the Ubuntu Community documentation or the Pendrivelinux instructions.

The USB "LiveCD" can be used to install (K)Ubuntu on computers (including netbooks) that do not have CD-ROM/DVD drives. See these instructions to boot from a USB flashdrive.

USB pendrives to be used to run (K)Ubuntu should have a minimum of 2 Gb (preferably 4 Gb). If you wish to install a fast, fully functional Linux system on a pendrive that has less memory than that, use PuppyLinux or Lubuntu.

USB Creator

You can make a "LiveCD" on a USB pendrive using USB Creator and either a LiveCD or an .iso version of the LiveCD stored on your hard drive. USB Creator is installed by default in (K)Ubuntu. If not, install:

sudo apt-get install usb-creator-gtk
  • Run:
Menu -> System -> Startup Disk Creator

Create a boot CD to allow booting from the USB drive

Many computers do not allow booting from a USB drive (but they do allow booting from the CD-ROM). You can create a CD-ROM using these Pendrivelinux instructions and set your BIOS to boot from this CD-ROM. When you boot from this CD-ROM, it will use the bootup files on the (K)Ubuntu USB drive you previously created (in the step above).


原文链接:http://ubuntuguide.org/wiki/Ubuntu_Trusty_System_Backup


Linux系统数据实时备份工具 rsync是Linux系统下的数据镜像备份工具,通过rsync可以将本地系统数据通过网络备份到任何远程主机上。rsync有如下特性:可以镜像保存整个目录树和文件系统可以增量同步数据,文件传输效率高,因而同步时间很短。可以保持原有文件的权限、时间等属性。加密传输数据,保证了数据的安全性。rsync有两种应用模式client/server模式client/client模式。rsyncrsync监听端口:873。 阅读详情

相关推荐

19、Linux系统的定期任务与数据备份策略

本文深入探讨了Linux系统中的定期任务处理和数据备份策略。内容涵盖了cron及相关工具如anacron和fcron的使用,详细分析了日志文件轮转、任务调度的最佳实践以及撤销用户滥用crontab权限的处理方式。在数据备份方面,文章提供了备份的重要性、通用建议、设备选择及常见命令,并设计了全量备份与增量备份的具体方案。此外,还介绍了开源备份工具Bacula和商业备份解决方案,帮助系统管理员保障数据安全并提高运维效率。

desk3的博客 70

备份linux系统_如何备份Linux系统

备份linux系统Yuriy Seleznev/Shutterstock.comYuriy Seleznev / Shutterstock.com Don’t risk data loss. Back up your valuable data from the Linux command line. We’ll be using the rsync command for this, and w...

culiuman3228的博客 1676

Ubuntu Customization Kit-开源

!!!项目终止!!! Ubuntu Customization Kit 是一种工具,可帮助您根据需要自定义官方 Ubuntu Live CD(包括 Kubuntu/Xubuntu 和 Edubuntu)。 您可以将任何包添加到实时系统,例如语言包或应用程序。

Linux系统管理---数据备份

目录 1、数据备份简介 1.Linux服务器中哪些数据需要备份 1)Linux系统重要数据 2)安装服务的数据 配置文件: 网页主目录: 日志文件: 二、备份策略(方式) 1.完全备份 2.增量备份 3.差异备份 三、备份工具dd 1.命令格式: 2.列题 例1:只备份文件 例2:备份分区为一个文件: 例3:备份分区到另一个新分区 例4:整盘备份: 3.dd缺点 四、XFS文件系统备份 XFSdump使用注意事项: 选项: 1、备份整个分区。 2、 指定备

m0_57911290的博客 3万+

善用Partimage做Linux备份.pdf

善用Partimage做Linux备份.pdf

Dify与钉钉轻量级集成:打造企业内部AI助手

企业级聊天机器人开发已成为提升内部协同效率的关键技术。其核心原理在于通过API集成,将AI模型能力与即时通讯平台无缝连接,实现智能问答与自动化流程。从技术价值看,这种集成方案能够显著降低AI应用落地门槛,将前沿的AI能力快速转化为实际生产力。在应用场景上,它尤其适用于HR答疑、IT技术支持、产品知识库等高频内部服务场景。本文聚焦于Dify与钉钉的轻量级集成方案,通过Stream模式实现高效消息处理,并利用AI卡片支持流式输出,为企业构建体验自然的智能机器人提供了完整实践路径。该方案特别强调配置简化与部署便捷

weixin_27155667的博客 694

ubuntu自定义菜单_如何轻松创建自定义Ubuntu Live CD或USB

ubuntu自定义菜单There are several different ways to create custom Ubuntu live CDs. We’ve covered using the Reconstructor web app in the past, but some commenters recommended the Ubuntu Customization Kit in...

culingluan4376的博客 796

[EDA系列]二、Altium Designer异形封装实战:从CAD导入到PCB布局

本文详细介绍了在Altium Designer中实现异形封装的实战流程。通过五步核心操作,将CAD软件中的复杂二维轮廓精准导入并转换为可直接用于PCB布局的智能封装,解决了不规则形状铺铜的难题,特别适用于射频天线、传感器外壳等对机械尺寸有严苛要求的设计场景。

weixin_29194817的博客 142

Linux数据备份

rw-r--r-- 1 root root 200M 11月 17 15:40 /tmp/boot.bak[root@localhost ~]# dd if=/tmp/boot.bak of=/dev/sda1。如果想要把分区直接备份成为另外一个分区,就需要生成一个新的分区,这个分区的大小不能比源分区小,只能和源分区一大小一致或比源分区大。适用于数据变动不是特别频繁,但希望定期检查历史状态的应用,它可以在较短的时间内生成较新的备份集,同时减少了恢复时间,但对连续的小变更仍有一定的备份间隔。

2202_75529223的博客 3620

【scp】Windows 下scp报错 bad permissions

Windows 下使用 SSH 连接报 Bad owner or permissions on C:\\Users\\Administrator/.ssh/config 错误问题解决 C:\Users\Administrator>scp -P 66666 D:\1111.pdf zzd@58.213.45.xx:/home/zzd/ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING:...

走在搬砖的路上! 4154

Windows域账户无管理员权限也能装软件?3步搞定UAC设置(附安全提醒)

本文探讨了在Windows域环境中,如何通过配置用户账户控制(UAC)实现临时提权,让无管理员权限的域账户也能安装软件。文章详细介绍了三步走策略:临时加入本地管理员组、调整UAC行为以及至关重要的权限回收,并提供了脚本化部署方案与安全实践指南,旨在平衡企业IT管理的效率与安全。

fox11的博客 756

如何备份Linux系统数据?

全量备份与增量备份结合:定期进行全量备份,日常进行增量备份,节省时间和存储空间。通过以上方法,您可以有效地备份Linux系统数据,保障数据的安全性和可恢复性。权限和所有权:确保备份文件和目录的权限和所有权正确,以便恢复时正常使用。备份前规划:明确备份内容、目标位置和备份频率,制定详细的备份计划。Mondo Rescue:创建可启动的备份光盘,恢复整个系统。备份验证:定期测试备份文件的完整性和可恢复性,确保备份有效。恢复:使用相同的命令将备份数据同步回原位置。备份:同步源目录到目标目录,支持增量备份。

mrzyun0811的博客 882

CTF实战:手把手教你用Python破解转轮机加密(附完整脚本)

本文详细介绍了如何使用Python逆向破解转轮机加密,特别针对CTF比赛中的Crypto类题目。通过解析转轮机加密原理、实战Python脚本编写及调试技巧,帮助参赛者快速掌握破解方法,提升在攻防世界等CTF比赛中的解题效率。

silver的专栏 1115

Linux系统数据备份详细操作步骤

Linux系统下数据备份操作步骤指南,涵盖文件系统备份、数据库备份及自动化方案

在阿尔法狗用361维向量重构围棋宇宙时,人们惊觉这团硅基智慧正以人类难以企及的速度逼近某种终极规律。 2852

开源大模型“去审查化”技术解析:从LLaMA架构到本地部署与伦理边界

大型语言模型(LLM)基于Transformer架构,通过海量数据训练获得理解和生成自然语言的能力。其核心原理在于自注意力机制对上下文关系的建模。为了确保输出内容的安全与合规,主流模型普遍采用基于人类反馈的强化学习(RLHF)等技术进行安全对齐。这一过程旨在使模型行为符合人类价值观,是AI伦理工程实践的关键环节。然而,在特定研究场景下,如对抗性测试或内容安全算法研究,技术人员需要模拟极端对话以评估系统鲁棒性,这催生了针对“去对齐”或“移除护栏”的技术探索。此类技术通常通过对预训练模型进行反向微调或继续训练来

weixin_33743880的博客 586

视图库对接系列(GA-T 1400)四、视图库对接系列(本级)注册

在之前的步骤中,我们已经把项目大体的架构已经写出来了。那我们就来实现注册接口。GA-T 1400中的步骤如下:这里的话,我们实现的简单点, 我们不进去鉴权,也就是设备或平台找我们注册的话,我们直接返回成功,不进行验证。如果需要鉴权的话可看我的另外一篇文档。

qq_37716298的博客 1042

Linux系统往Window系统定时备份数据

Linux系统之间备份数据比较简单,你可以用resync和其他工具备份数据,但是小白我发觉LINUX往我Windows上面备份数据好像不行,所以就用了以下比较蠢的办法: 我用到的是Linux samba服务器和Crontab任务管理还有Window上面的任务计划管理,我的Linux版本是Centos 6.5虚拟机,然后windows版本是Win7 1首先是Linux上面的samba服务器,有些

qq_26614295的博客 2240

第3版•系统集成项目管理工程师(中级) │ 告别迷茫!案例分析高分攻略

🥏第3版•系统集成项目管理工程师(中级) │ 告别迷茫!案例分析高分攻略

✨ 欢迎来到【Seal ^_^ 的优快云博客】!✨ 3867

linux的常用备份方法,Linux系统下常用的数据备份方法

Linux系统下常用的数据备份方法发布时间:2009-10-28 15:11:36来源:红联作者:szlfengLinux系统下常用的数据备份方法1、本机上数据的手工备份Linux系统上配有功能强大的tar命令,可以灵活地备份数据。tar最初是为了制作磁带备份而设计的把文件和目录备份到磁带中,然后从磁带中提取或恢复文件。当然,现在我们可以使用tar来备份数据到任何存储介质上。tar非常易于使用稳定...

weixin_39966020的博客 3539

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

Linux系统的快照创建——数据备份

Linux系统的快照创建——数据备份 当我们利用逻辑卷存储文件时,可能会碰到逻辑卷会损坏的情况,那么逻辑卷中的文件就会出现问题甚至会丢失。这时我们就需要对逻辑卷创建快照,当快照损坏时,再重新创建一个就可以了。 快照逻辑卷是 LVM 存储的另一项灵活功能。 LVM 快照是临时保留所更改的逻辑卷的原始数据的逻辑卷。快照提供原始卷的静态视图,从而能够以一致状态备份其数据,快照卷大小只需足以存储在它存在...

Sunrise的博客 6378

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

linux的常用备份方法,Linux系统下一些常用的数据备份方法

Linux作为新一代网络操作系统,在服务器方面的应用越来越广泛。作为专门的网络服务器,一个重要功能就是对服务器数据进行备份,以确保数据的安全。本文将介绍在Linux系统下一些常用的数据备份方法。1、本机上数据的手工备份Linux系统上配有功能强大的tar命令,可以灵活地备份数据。tar最初是为了制作磁带备份而设计的把文件和目录备份到磁带中,然后从磁带中提取或恢复文件。当然,现在我们可以使用tar来...

weixin_35604021的博客 1654

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

linux系统路由怎么备份,如何在Linux系统下自动备份MySQL数据?

如何在Linux系统下自动备份MySQL数据?1.先创建一个数据库备份目录:mkdir backupcd backupmkdir mysqlbackupcd mysqlbackup2.创建备份脚本vi mysqlautobackup3.编写脚本:filename=`date +%Y%m%d`/mysql的bin目录/mysqldump --opt 数据库名 -u(mysql账号) -p(mysql...

weixin_31237295的博客 243

linux系统定时备份Mysql数据库

linux系统定时备份Mysql数据库

weixin_44916936的博客 525

linux系统定时备份MySQL数据库

一个项目的基础便是数据库,但是可能因为某些原因会导致数据丢失,或数据库结构变化,严重一点的或造成数据库删除。为了以防万一,这时候就需要我们定时进行数据库备份,但是如果人来操作的话会是一个比较麻烦的工程,这时我们可以使用mysqldump写个脚本,由Linux的crontab来定时执行。下面看看具体操作过程。 假如在我的数据库中有一个emp的数据库。 1.在linux系统中自定义一个文件夹,在我的服...

Java旅途 329

linux自动备份系统快照,Linux操作系统备份之一:使用LVM快照实现Linux操作系统数据的在线备份...

这里我们讨论Linux操作系统的备份。在生产环境,客户都会要求做全系统的数据备份,用于系统崩溃后的一种恢复手段。这其中就包含操作系统数据的备份恢复。由于是生产环境,客户都会要求备份不中断业务,也就是在线备份。今天我们介绍使用LVM快照实现Linux操作系统在线备份的一种方法。使用LVM实现操作系统在线备份的简要原理是:LVM是Linux自带的卷管理软件,LVM支持快照,而Linux又支持将LVM卷...

weixin_35051558的博客 632
上一篇: Linux 系统之Apt-Get命令使用
下一篇: Linux系统之XFCE4.10 安装
tkp2014
博客等级 码龄12年 137粉丝 241原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值