FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-github-backup/bin/github-backup at master · k0rnpisey/python-github-backup · GitHub
k0rnpisey
/
python-github-backup
Public
forked from
josegonzalez/python-github-backup
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-github-backup
/
bin
/
github-backup
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
52 lines (42 loc) · 1.29 KB
Breadcrumbs
python-github-backup
/
bin
/
github-backup
Copy path
File metadata and controls
executable file
·
52 lines (42 loc) · 1.29 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env python
import
os
,
sys
,
logging
from
github_backup
.
github_backup
import
(
backup_account
,
backup_repositories
,
check_git_lfs_install
,
filter_repositories
,
get_authenticated_user
,
log_info
,
log_warning
,
mkdir_p
,
parse_args
,
retrieve_repositories
,
)
logging
.
basicConfig
(
format
=
'%(asctime)s.%(msecs)03d: %(message)s'
,
datefmt
=
'%Y-%m-%dT%H:%M:%S'
,
level
=
logging
.
INFO
)
def
main
():
args
=
parse_args
()
output_directory
=
os
.
path
.
realpath
(
args
.
output_directory
)
if
not
os
.
path
.
isdir
(
output_directory
):
log_info
(
'Create output directory {0}'
.
format
(
output_directory
))
mkdir_p
(
output_directory
)
if
args
.
lfs_clone
:
check_git_lfs_install
()
if
not
args
.
as_app
:
log_info
(
'Backing up user {0} to {1}'
.
format
(
args
.
user
,
output_directory
))
authenticated_user
=
get_authenticated_user
(
args
)
else
:
authenticated_user
=
{
'login'
:
None
}
repositories
=
retrieve_repositories
(
args
,
authenticated_user
)
repositories
=
filter_repositories
(
args
,
repositories
)
backup_repositories
(
args
,
output_directory
,
repositories
)
backup_account
(
args
,
output_directory
)
if
__name__
==
'__main__'
:
try
:
main
()
except
Exception
as
e
:
log_warning
(
str
(
e
))
sys
.
exit
(
1
)
Back
|
FazBrowse Home
|
New Git URL