Created
January 19, 2021 20:23
-
-
Save fhdalikhan/7bf196c60afb16fa7b61959a9540cc2c to your computer and use it in GitHub Desktop.
Cronjob for syncing project with git repo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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