Skip to content

Instantly share code, notes, and snippets.

@fhdalikhan
Created January 19, 2021 20:23
Show Gist options
  • Save fhdalikhan/7bf196c60afb16fa7b61959a9540cc2c to your computer and use it in GitHub Desktop.
Save fhdalikhan/7bf196c60afb16fa7b61959a9540cc2c to your computer and use it in GitHub Desktop.
Cronjob for syncing project with git repo
/bin/sh -c 'cd /home/public_html/project && /usr/bin/git fetch --all && /usr/bin/git reset --hard origin/master' 2>&1 | /home/timestap.sh >> /home/project_cronjob.log
#!/bin/bash
while read x; do
echo -n `date +%d/%m/%Y\ %H:%M:%S`;
echo -n " ";
echo $x;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment