User Tools

Site Tools


linux:push_to_git

Auto push_to_git script

Documentation
Name: Auto push_to_git script
Description: Automatic push changes to git (noprompt).
Modification date : 29/04/2019
Owner:dodger
Notify changes to: dodger
Tags:

Instructions

Get script on gitea

Pre-Requisites

On git*:

  • Create a repository in which the auto push will upload the data
  • Generate a ssh keypair in the source host.
  • Add the public ssh key to the repository with write permissions.

On the machine push_to_git will run:

  • Make the 1st pull into the directory.
  • Add all the files.
  • Run push_to_git manually and check if it works.

Setup

Add the directories to push_to_git.config:

push_to_git.config
FOLDERS="/home/www/dokuwiki.ciberterminal.net"

Add the script to crontab:

cat >>/etc/crontab<<EOF
 
# AUTO push_to_git folders
0   *   *   *   * root  /home/dodger/push_to_git/push_to_git.sh
EOF

usage

bash /home/dodger/push_to_git/push_to_git.sh
linux/push_to_git.txt · Last modified: 2022/02/11 11:36 (external edit)