![]() This page refers to GNU sync, which is distributed with most Linux operating systems. If no arguments are provided, all mounted file systems are synced. Individual files may be synced, or the entire filesystem containing the specified files. Run sync if you anticipate the system to be unstable, or the storage device to become suddenly unavailable, and you want to ensure all data is written to disk. The sync command forces an immediate write of all cached data to disk. Writes are buffered (cached) in memory, and written to the storage device at the optimal time. The directory syncs you create are a perfect backup plan for critical data in case of accidental deletion or evidence of corrupt files.By default, the Linux kernel writes data to disk asynchronously. Osync is an ideal two-way synchronization solution for local-to-local and local-to-remote directories. */5 * * * * osync.sh -initiator="/home/dnyce/LinuxShellTips" -target="ssh:// :22//home/ubuntu/linuxshelltips_remotesync" */5 * * * * osync.sh -initiator="/home/dnyce/LinuxShellTips" –target="/home/dnyce/LinuxShellTips_Backup" $ sudo suĪdding the following two cron jobs for local-to-local and local-to-remote directories will automate our osync tasks. We could automate the Quick Sync mode tasks through cron jobs. summary -errors-only -no-prefixįor example: $ osync.sh -initiator="/path/to/another/directory"-target="ssh:// /IP:22//path/to/directory2" -summary -errors-only -no-prefixĬonfiguring a Cron Job to Automate File Sync However, your osync command can include the following command options to help you diagnose critical errors. The local-to-remote Quick Sync syntax is as follows: $ osync.sh -initiator="/path/to/another/directory" -target="ssh:// /IP:22//path/to/directory2"Īn example implementation would look like the following: $ sudo osync.sh -initiator="/home/dnyce/LinuxShellTips" -target="ssh:// :22//home/ubuntu/linuxshelltips_remotesync"ĭo not worry about osync finished with warnings, It’s just that I disabled pinging on my server. For local-to-local directories, consider the following osync syntax: $ osync.sh -initiator="/path/to/directory1" -target="/path/to/directory2"Īs example implementation is as follows: $ sudo osync.sh -initiator="/home/dnyce/LinuxShellTips" –target="/home/dnyce/LinuxShellTips_Backup"įor local-to-remote directories, you might need to first configure your machine for SSH passwordless access. This approach is however convenient for users seeking to achieve fast syncs between directories. Local-Local and Local-Remote File Sync Using Quick Sync Mode #FILE SYNCHRONIZATION UBUNTU HOW TO#How to Use Osync in Linux for Two-Way File SynchronizationĪs already mentioned, there are three approaches to using osync. While cloning osync from Github, removing the -b "stable" option from the git clone command will retrieve osync’s latest dev snapshot. #FILE SYNCHRONIZATION UBUNTU INSTALL#Install Osync in OpenSUSE Linux $ sudo zypper install git Install Osync in Arch Linux $ sudo pacman -S git Install Osync in Debian-based Distors $ sudo apt install git Install Osync in RHEL-based Distors $ sudo yum install git Use one of the following installation guides as per your Linux operating system distribution. You first need to have git installed before you can retrieve and install the osync file synchronization tool from Github. Install Osync in LinuxĪ stable or latest version of osync can be found on Github. Soft deletes or conflictual files are preserved through created backups. Osync’s primary design prevents it from deleting user/system data. A target/initiator sync schema is also applicable under osync.Ī preexisting target/initiator replica is shielded from multiple concurrent sync processes through pidlocks. If you need speedy execution, you might want to disable some of the osync features like disk space checks and attribute preservation. Multiple backups and soft deletions handling.Command execution for before/after runs.Extended attributes and POSIX ACL synchronization.Resume scenarios to handle fault tolerance.Handles multiple sync tasks through the batch runner and failed sync tasks through a rerun option.Local-to-Local and Local-to-Remote synchronization support.The local-to-local replication run takes approximately 2 seconds whereas the local-to-remote replication run takes approximately 7 seconds. These runs can be local-to-local or local-to-remote. This attribute also makes it agentless.īetween two runs, osync will compare replica file lists. Osync is attributed as stateful because it is not obligated to monitor the targeted files for changes. This stateful synchronizer acts as a rsync wrapper. via a daemon (triggered when new file changes occur). ![]() You might ask yourself, why do I need a two-way/bidirectional file synchronization solution? The terminal-based nature of osync makes it an ideal file synchronization solution that can be executed in three modes: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |