{"id":16780519,"url":"https://github.com/monolithprojects/simpleosbackup","last_synced_at":"2025-07-08T19:36:22.903Z","repository":{"id":115679685,"uuid":"83140003","full_name":"MonolithProjects/SimpleOSbackup","owner":"MonolithProjects","description":"Tool used for creating bootable Linux OS backup.","archived":false,"fork":false,"pushed_at":"2017-12-10T14:47:45.000Z","size":66,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-01-23T06:45:17.090Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MonolithProjects.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog_SimbleOSbackup","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-25T15:14:43.000Z","updated_at":"2021-10-24T16:57:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"ed9becb2-0d88-42f3-a3eb-0bff7461dc39","html_url":"https://github.com/MonolithProjects/SimpleOSbackup","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MonolithProjects%2FSimpleOSbackup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MonolithProjects%2FSimpleOSbackup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MonolithProjects%2FSimpleOSbackup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MonolithProjects%2FSimpleOSbackup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MonolithProjects","download_url":"https://codeload.github.com/MonolithProjects/SimpleOSbackup/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243925990,"owners_count":20369914,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T07:35:20.567Z","updated_at":"2025-03-16T20:21:13.805Z","avatar_url":"https://github.com/MonolithProjects.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"***About SimpleOSbackup***\n\nSimpleOSbackup or simply - SOSbackup is a bash shell script used for backup of Linux OS system. \nYou can run backup to a partition or whole disk. In case you are running backup to a partition, \nthe backup will exclude  boot  fs (/boot, /boot/efi etc.). If you are running backup to a disk, \nSOSbackup will erease current partition table on it (if there is any) and create a new one. \nMore info in the section of specific functions\n\nBackup is fully operational and can be choosen from GRUB or LILO menu and booted. The boot loader on the original \ndisk is still needed. So far the boot loader on the backup device does not work. In situation where your \noriginal disk will fail you will need to install the GRUB or LILO manually to the backup device.\nOne day maybe i will implement that function into the script too :). However, the boot loader config \nfile will be configured by SOSbackup so you will not need to edit it manually. \nYou must have root privileges to be able to run SOSbackup for OS backup.\nThis script was tested on several Linux distributions in various configurations. \n\t    \nI am not responsible for any damage done using this tool.\n\n\n**Functions**\n\nThe main function of SOSbackup is to create a bootable copy og your system. SOSbackup will automatically edit fstab on the\nbackup disk and add backup device to thr boot loader config file (Grub Legacy, Grub 2.0, LILO). Tt will chek the size of the\ndestination device, check if all components are present, generate a log file and send a report via email.\n\n**Create backup to the partition (option -p):**\nYou can backup the system to a separate disk partition. This option will exclude your current boot partition (for example /boot)\nso this fs will be used also by OS boot from the backup device. However SOSbackup will create a copy of current kernel and\ninitramfs on it (the kernel version in the file name will be replaced with word \"SOSbackup\"). In /etc/sosbkp.conf you can exclude\nanother folders or files which you do not want to backup. before you start the backup, your destination backup partition needs\nto be formatted with the same type of fas as is using your current root partition. \n\n**Create backup to the disk (option -d):**\nYou can backup the system to a separate disk. You need one empty disk drive. SOSbackup will automatically create \na boot partition with the same size as the original and format it to vfat for EFI+GPT or to ext2 BIOS+MBR. \nThen it will create a second partition for the rest of the data (size will depend of the size of backed up the data)\nand format it to ext4 or xfs (depends on what filesystem is using the original root partition). If yum are using LILO, \nSOSbackup will install aslo the boot loader into the backup disk. If you are using Grub, you will need to boot the backup OS and\ninstall it manually to the backup disk (just run grub-install or grub2-install). This will help you to boot your backup system in \ncase your primary boot disk will fail.\n\n**Standard output:**\n```\n[root@localhost ~]# ./sosbkp -d vdb\nChecking the user.................................[OK]\nLooking for destination...........................[OK]\nChecking mailx....................................[MISSING]\nChecking rsync....................................[OK]\nChecking dracut...................................[OK]\nCheckink if the destination is already mounted....[OK]\nCheckink last patching date.......................[OK]\nCollectiong information...........................[OK]\nChecking the destionation disk size...............[OK]\nChecking destination type.........................[OK]\nEditing partition table...........................[OK]\nFormatting /dev/vdb1 and /dev/vdb2................[OK]\nMounting backup device............................[OK]\nCreating copy of current kernel...................[OK]\nRunning backup....................................[OK]\nEditing fstab on backup device....................[OK]\nEditing GRUB......................................[NO CHANGE]\nUnmounting backup device..........................[OK]\n```\n\n**Good to know:**\n\nYou will need to have root privileges to crate a backup or view the state of previous backup.\n\nBackup will be interrupted if the backup destination is already mounted, if the running kernel was installed less than 7 days back,\nif the destination is too small (all can me overcomed by option -f).\n\nBackup will fail if tool rsync is missing. It will fail also if dracut is missing but you can force the backup by option -f.\nIf mailx is missing, you will be onl informed about that (of course the report will be not sent via email).\n\nThe SOSbackup will always delete the data from backup device before it will create a copy. This behaviour can be changed by option -n \nis accepted for backup to partition (-p).\n\nIf the config file /etc/sosbkp.conf is missing, SOSbackup will generate one by the first run.\n\n**How to use sosbkp:**\n```\nsosbkp [OPTIONS]...\n```\n\n**Arguments:** \n```\n-p \u003cpartition\u003e, --to-partition=\u003cpartition\u003e  Start SOSbackup to the partition \n                              THIS OPTION NEEDS TO BE ON THE END OF THE COMMAND \n                              Partition needs to be formated before you start SOSbackup. \n                              If you are using LVM partition as the destination, use path /dev/mapper/...\n                              SOSbackup will erease all data on the partition by default.\n                              This argument needs to be the last one.\n\t    \n-d \u003cdisk\u003e, --to-disk=\u003cdisk\u003e   Start SOSbackup to the disk.  \n                              THIS OPTION NEEDS TO BE ON THE END OF THE COMMAND \n                              SOSbackup will erease existing partitions on the backup device any and create\n                              two new partitions. The first one is for boot fs and the second for the rest\n                              of the data. SOSbackup will edit boot loader menu and add the new boot device.\n`                              The backup device will be not bootable (even the configuration \n                              files are ready and do not need to be edited). In case your \n                              original boot device will fail or damage, you will need to \n                              install the boot loader to the new disk (backup disk).\n                              This argument needs to be the last one.\n    \n-S, --shutdown                Shutdown after backup \n\t    \n-x, --no-email                Report will be not sent via email \n\t    \n`-X, --no-selinux              Do not copy SELinux labels \n\t    \n-c, --clear                   Can be used after interrupted backup \n\t    \n-n, --no-delete               Do NOT delete previous backup data. Will update current backup. \n                              Keep in mind that rsync needs some free space for temporarry files. \n\t    \n-s, --show                    Show last backup info \n\t    \n-f, --force                   Force backup and suppress warnings. (Missing rsync can not be suppresed) \n\n\n-v, --version                 Show SOSbackup version \n\t    \n    --debug                   Debug mode \n\t    \n-h, --help                    This Help page\n```  \n**Examples:**\n\n```\nsosbkp --to-partition=/dev/sdb1 \nsosbkp -Sxp /dev/sdb1 \nsosbkp -S -f -p /dev/mapper/backup_vg-backup_lv \nsosbkp --no-selinux -d /dev/sdc \nsosbkp -d sdc\n```\n\n**Config file**\n```\n### Simple OS backup configuration file\n### Exclude following folders from backup\nEXCLUDE=(/mnt /media /lost+found)\n\n### Log file location\nLOGFILE=/var/log/myoscopy.log\n\n### Path to custom shutdown script (optional)\nSHUTSCRIPT=\n\n### GRUB title for backup disk (This will be ignored if you are using LILO. For LILO is the title/label hardcoded as \"SOSbackup\")\nTITLE=\"Boot from SOSbackup disk\"\n\n### Email address where you want to receive the report\nEMAIL=youremail@yourdomain.com\n\n\n### External Gmail SMTP server:\n\n### Server address and port\nSMTP=\"smtp.gmail.com:587\"\n\n### User name for the email account in format \"something@gmail.com\"\nSMTPUSER=\"sosbkpsenderemail@gmail.com\"\n\n### Password to the email account\n### You need to allow access for less secure apps - https://www.google.com/settings/security/lesssecureapps\nSMTPPASS=\"\"\n\n### Certificates\nNSSCONFIGDIR=\"/etc/pki/nssdb/\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonolithprojects%2Fsimpleosbackup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonolithprojects%2Fsimpleosbackup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonolithprojects%2Fsimpleosbackup/lists"}