• Home
    • Cool Knowledge base
    • Light Knowledge base
    • Help Desk
    • OnePage Documentation
  • Services
    • Main Services
    • PPC Services
    • SEO Services
    • SMM Services
  • Docs
  • Blog
    • Affiliate
    • Ecommerce
    • Frontend
    • linux
      • nginx
    • PHP
      • Magento
      • wordpress
    • Python
    • SEO
    • Web
  • Forum
    • Forums
    • Forum Topics
    • Topic Details
    • Ask Question
  • Pages
  • Contact

Subscribe to Updates

Get the latest creative news from FooBar about art, design and business.

What's Hot

VideoJS – multiple source demo

2022-03-08

Add custom field to Woocommerce tab

2022-03-07

Surror Product Tabs for WooCommerce

2022-03-07
Facebook Twitter Instagram
  • 中文
  • English
Facebook Twitter Instagram Pinterest VKontakte
SEO & Website build tips SEO & Website build tips
  • Home
    • Cool Knowledge base
    • Light Knowledge base
    • Help Desk
    • OnePage Documentation
  • Services
    • Main Services
    • PPC Services
    • SEO Services
    • SMM Services
  • Docs
  • Blog
    • Affiliate
    • Ecommerce
    • Frontend
    • linux
      • nginx
    • PHP
      • Magento
      • wordpress
    • Python
    • SEO
    • Web
  • Forum
    • Forums
    • Forum Topics
    • Topic Details
    • Ask Question
  • Pages
  • Contact
SEO & Website build tips SEO & Website build tips
Home»Python»sh auto push static content to github -gogit
Python

sh auto push static content to github -gogit

OxfordBy Oxford2018-12-29No Comments1 Min Read
Facebook Twitter Pinterest LinkedIn Tumblr Email
Share
Facebook Twitter LinkedIn Pinterest Email
2016-03-28 发布

一个结合crontab定时推送github或coding库小玩意 

gogit

 2.5k 次阅读  ·  读完需要 4 分钟
0

 

gogit

一个结合crontab定时推送github或coding库小玩意。

Github:https://github.com/HavenShen/gogit

注:运行此玩意的电脑,必须可运行python、已经配置好github和coding使用ssh key 无密钥通道git的ssh获取方式(推荐使用常年不关机的linux服务器)。

配置参考:Git配置安装使用教程操作github上传克隆数据

安装

1.克隆此库

git clone [email protected]:HavenShen/gogit.git

配置推送github同时提交coding库

1.在自己的github和coding中创建自己的新库

可取名如:mygogit取得自己的ssh地址

  • [email protected]:xxx/mygogit.git
  • [email protected]:xxx/mygogit.git

2.修改及增加刚在github克隆的库目录下gogit/.git/config文件中的[remote "origin]"节点下url路径

url = [email protected]:xxx/mygogit.git
url = [email protected]:xxx/mygogit.git

设置crontab定时任务


#编辑定时任务

crontab -e

#键入每天下午3点执行命令

00 15 * * * python /home/gitfile/gogit/main.py #这边执行路径按自己的库目录而改动

#保存退出

:wq
  

搞定。

坐等任务每天帮你填补github空地,以及coding每天推送代码的 + 0.01码币

错误反馈

1.如果crontab不执行python脚本

在main.py文件头部加入

#!/usr/bin/python #对应python环境变量路径

把Python(main.py)的属性改为可执行

chmod a+x main.py

修改crontab

crontab -e
00 15 * * * /home/gitfile/gogit/main.py

License

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Avatar photo
Oxford

Related Posts

How To Scrape Amazon at Scale With Python Scrapy, And Never Get Banned

2022-01-08

linked-in get email info via python

2019-12-31

python login and craw email address

2019-12-18

How To Crawl A Web Page with Scrapy and Python 3

2018-11-29
Recent Posts
  • VideoJS – multiple source demo
  • Add custom field to Woocommerce tab
  • Surror Product Tabs for WooCommerce
  • How To Scrape Amazon at Scale With Python Scrapy, And Never Get Banned
  • Compile a Jekyll project without installing Jekyll or Ruby by using Docker
December 2018
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930
31  
« Nov   Jan »
Tags
app branding culture design digital Docly docs etc faq fashion featured fitness fix github Helpdesk Image issue leisure lifestyle magento Manual marketing memecached Photography picks planing seo sequrity tips Travel trending ui/ux web WordPress 爬虫
Editors Picks

Fujifilm’s 102-Megapixel Camera is the Size of a Typical DSLR

2021-01-05
Top Reviews
8.9

Review: Xiaomi’s New Loudspeakers for Hi-fi and Home Cinema Systems

By Oxford
8.9

Which LED Lights for Nail Salon Safe? Comparison of Major Brands

By Oxford
70

CES 2021 Highlights: 79 Top Photos, Products, and Much More

By Oxford
Advertisement
Demo
  • Facebook
  • Twitter
  • Instagram
  • Pinterest
About Us
About Us

Your source for the lifestyle news. This demo is crafted specifically to exhibit the use of the theme as a lifestyle site. Visit our main page for more demos.

We're accepting new partnerships right now.

Email Us: [email protected]
Contact: +1-320-0123-451

Facebook Twitter Instagram Pinterest YouTube LinkedIn
Recent Posts
  • VideoJS – multiple source demo
  • Add custom field to Woocommerce tab
  • Surror Product Tabs for WooCommerce
  • How To Scrape Amazon at Scale With Python Scrapy, And Never Get Banned
  • Compile a Jekyll project without installing Jekyll or Ruby by using Docker
From Flickr
Ascend
terns
casual
riders on the storm
chairman
mood
monument
liquid cancer
blue
basement
ditch
stars
© 2025 Designed by 九号资源网.

Type above and press Enter to search. Press Esc to cancel.