-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME
143 lines (90 loc) · 3.64 KB
/
README
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
NAME
Github::Backup - Back up your Github repositories and/or issues locally
SYNOPSIS
github-backup \
--user stevieb9 \
--token 003e12e0780025889f8da286d89d144323c20c1ff7 \
--dir /home/steve/github-backup \
--repos \
--issues
# You can store the token in an environment variable as opposed to sending
# it on the command line
export GITHUB_TOKEN=003e12e0780025889f8da286d89d144323c20c1ff7
github-backup -u stevieb9 -d ~/github-backup -r
DESCRIPTION
The cloud is a wonderful thing, but things do happen. Use this
distribution to back up all of your Github repositories and/or issues
to your local machine for both assurance of data accessibility due to
outage, data loss, or just simply off-line use.
COMMAND LINE USAGE
-u | --user
Mandatory: Your Github username.
-t | --token
Mandatory: Your Github API token. If you wish to not include this on
the command line, you can put the token into the GITHUB_TOKEN
environment variable.
-d | --dir
Mandatory: The backup directory where your repositories and/or issues
will be stored. The format of the directory structure will be as
follows:
backup_dir/
- issues/
- repo1/
- issue_id_x
- issue_id_y
- repo2/
- issue_id_a
- repo1/
- repository data
- repo2/
- repository data
The repositories are stored as found on Github. The issues are stored
in JSON format.
-r | --repos
Optional: Back up all of your repositories found on Github.
Note that either --repos or --issues must be sent in.
-i | --issues
Optional: Back up all of your issues across all of your Github
repositories.
Note that either --issues or --repos must be sent in.
-p | --proxy
Optional: Send in a proxy in the format https://proxy.example.com:PORT
and we'll use this to do our fetching.
-h | --help
Display the usage information page.
MODULE METHODS
new
Instantiates and returns a new Github::Backup object.
Parameters:
api_user
Mandatory, String: Your Github username.
token
Mandatory, String: Your Github API token. Note that if you do not wish
to store this in code, you can put it into the GITHUB_TOKEN environment
variable, and we'll read it in from there instead.
dir
Mandatory, String: The directory that you wish to store your downloaded
Github information to.
proxy
Optional, String: Send in a proxy in the format
https://proxy.example.com:PORT and we'll use this to do our fetching.
repos
Takes no parameters. Backs up all of your Github repositories, and
stores them in the specified backup directory.
issues
Takes no parameters. Backs up all of your Github issues. Stores them
per-repo within the /backup_dir/issues directory.
FUTURE DIRECTION
- Slowly, I will add new functionality such as backing up *all* Github
data, as well as provide the ability to restore to Github the various
items.
- Add more tests. Usually I don't release a distribution with such few
tests, but in this case I have. I digress.
AUTHOR
Steve Bertrand, <steveb at cpan.org>
LICENSE AND COPYRIGHT
Copyright 2017,2018 Steve Bertrand.
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.