Skip to content

Latest commit

 

History

History
58 lines (56 loc) · 4.11 KB

README.md

File metadata and controls

58 lines (56 loc) · 4.11 KB
    
 ██████╗ ██████╗ ███╗   ██╗███████╗██╗   ██╗███╗   ██╗ ██████╗██████╗  ██████╗ ███╗   ██╗██╗███████╗███████╗
██╔════╝██╔═══██╗████╗  ██║██╔════╝╚██╗ ██╔╝████╗  ██║██╔════╝██╔══██╗██╔═══██╗████╗  ██║██║╚══███╔╝██╔════╝
██║     ██║   ██║██╔██╗ ██║███████╗ ╚████╔╝ ██╔██╗ ██║██║     ██████╔╝██║   ██║██╔██╗ ██║██║  ███╔╝ █████╗  
██║     ██║   ██║██║╚██╗██║╚════██║  ╚██╔╝  ██║╚██╗██║██║     ██╔══██╗██║   ██║██║╚██╗██║██║ ███╔╝  ██╔══╝  
╚██████╗╚██████╔╝██║ ╚████║███████║   ██║   ██║ ╚████║╚██████╗██║  ██║╚██████╔╝██║ ╚████║██║███████╗███████╗
 ╚═════╝ ╚═════╝ ╚═╝  ╚═══╝╚══════╝   ╚═╝   ╚═╝  ╚═══╝ ╚═════╝╚═╝  ╚═╝ ╚═════╝ ╚═╝  ╚═══╝╚═╝╚══════╝╚══════╝
                                                                                                     
                                      Script to syncronize files

MadeBy Codename Supported OS Licence watchers

About my project

The conssincronize is a product of © PSociety by jonas52! Copyright (C) 2021-2022 © PSociety. All rights reserved.

For problems or ideas for additions related to my code do not hesitate to contact me: [email protected]

This script can:

  • Syncronize files or folder (Nas whit a rasperrby (or the reverse))

To run my script

  • Download whit : git clone https://github.com/jonas52/consyncronize
  • nano consyncronize.sh to change the variables (user_name, password, nas_ip, NAS_DEST_DIR)
  • Check the options you want to add/remove with rsync (option explained later in the script) Default : -avz
sudo apt-get install openssh
sudo apt-get install sshpass

or

pacman -S openssh
pacman -S sshpass

or

sudo yum install openssh
sudo yum install sshpass

and

sudo chmod +x consyncronize.sh
sudo bash consyncronize.sh

Options rsync

  • -a: recursively copies and retains file attributes such as permissions, owners and groups.
  • -v: displays detailed information about the files that are copied.
  • -z: compresses data in transit to speed up transmission.
  • -h: displays the size of the files in a human readable way (for example, using units such as M for megabyte).
  • --delete: deletes files that do not exist on the source, but are present on the destination.

For script automation

execute the file every hour in the proposal below (so backup every hour)

  • 1 >>> crontab -e : open a configuration file
  • 2 >>> In this file add : 0 * * * * /Path/consyncronize.sh
  • 3 >>> Save the file
  • And the file will run every hour to save your files

Licence