backup_paradise 1.2.13

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of backup_paradise might be problematic. Click here for more details.

Files changed (37) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +231 -0
  3. data/backup_paradise.gemspec +51 -0
  4. data/bin/backup_paradise +7 -0
  5. data/doc/README.gen +214 -0
  6. data/doc/TODO.md +221 -0
  7. data/lib/backup_paradise.rb +5 -0
  8. data/lib/backup_paradise/advanced_backup/advanced_backup.rb +53 -0
  9. data/lib/backup_paradise/advanced_backup/audio.rb +124 -0
  10. data/lib/backup_paradise/advanced_backup/constants.rb +34 -0
  11. data/lib/backup_paradise/advanced_backup/data_directory.rb +50 -0
  12. data/lib/backup_paradise/advanced_backup/do_perform_the_backup_tasks.rb +95 -0
  13. data/lib/backup_paradise/advanced_backup/initialize.rb +38 -0
  14. data/lib/backup_paradise/advanced_backup/menu.rb +280 -0
  15. data/lib/backup_paradise/advanced_backup/misc.rb +836 -0
  16. data/lib/backup_paradise/advanced_backup/reset.rb +56 -0
  17. data/lib/backup_paradise/advanced_backup/run.rb +26 -0
  18. data/lib/backup_paradise/advanced_backup/system_directory.rb +35 -0
  19. data/lib/backup_paradise/base/base.rb +440 -0
  20. data/lib/backup_paradise/base/colours.rb +123 -0
  21. data/lib/backup_paradise/base/constants.rb +16 -0
  22. data/lib/backup_paradise/constants/constants.rb +192 -0
  23. data/lib/backup_paradise/gui/gtk2/backup.rb +345 -0
  24. data/lib/backup_paradise/gui/gtk3/backup.rb +383 -0
  25. data/lib/backup_paradise/project/project_base_directory.rb +22 -0
  26. data/lib/backup_paradise/requires/require_the_backup_paradise_project.rb +14 -0
  27. data/lib/backup_paradise/tab/tab.rb +84 -0
  28. data/lib/backup_paradise/toplevel_methods/cliner.rb +16 -0
  29. data/lib/backup_paradise/toplevel_methods/colours.rb +80 -0
  30. data/lib/backup_paradise/toplevel_methods/e.rb +16 -0
  31. data/lib/backup_paradise/toplevel_methods/help.rb +88 -0
  32. data/lib/backup_paradise/toplevel_methods/misc.rb +343 -0
  33. data/lib/backup_paradise/toplevel_methods/mountpoint.rb +80 -0
  34. data/lib/backup_paradise/toplevel_methods/opnn.rb +21 -0
  35. data/lib/backup_paradise/version/version.rb +19 -0
  36. data/lib/backup_paradise/yaml/config.yml +22 -0
  37. metadata +178 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b048638d75f2f38d8c1d22871cd07d78dbbfe10cf70c4dbdc7285a582f976f85
4
+ data.tar.gz: 9eb0f5e56e2cc411ce54a0d122b34950fd41d92f849aef1ea489a1a46a9f30a7
5
+ SHA512:
6
+ metadata.gz: b5cfd3354fba7f9157929001c68c4549d7a5a066af34410300803175d4508d1dc1a510d021e172116c1098c07f06c728d0b198032bb6bd4370a840f6dfbc5035
7
+ data.tar.gz: b8266dfd1ce3baa92c993afbcff5e549dfc6bdffae3029f8b1a997ad0dba571948836de86499d099293e7169270b4a00673218376208bbce19423b44ee521b72
data/README.md ADDED
@@ -0,0 +1,231 @@
1
+ # Backup Paradise
2
+
3
+ [![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)](https://www.gobolinux.org/)
4
+ [![forthebadge](http://forthebadge.com/images/badges/made-with-ruby.svg)](https://www.ruby-lang.org/en/)
5
+ [![Gem Version](https://badge.fury.io/rb/backup_paradise.svg)](https://badge.fury.io/rb/backup_paradise)
6
+
7
+ This project attempts to assist you - and me - in backing up data
8
+ to an **external USB** device.
9
+
10
+ Do note that the project is currently catering to my own use cases,
11
+ so it may not be very useful to other ruby users. I may make
12
+ adjustments for other ruby users, but this may take some time.
13
+
14
+ The project is primarily just a fancy **recursive copy** operation,
15
+ but it will do some minor additional notifications on the commandline,
16
+ use colours (if the colours gem has been installed), automatically
17
+ create some log files and even provide some semi-complete ruby-gtk
18
+ bindings. So it is a **recursive copy** script with some add-ons.
19
+
20
+ The project has **one major goal** and a **few minor goals**. The major
21
+ goal is to be usable as a backup-assistant.
22
+
23
+ The **minor goals** include:
24
+
25
+ - Flexibility (to back up only individual files or directories)
26
+ - Notify the user about the status of the backup-operation
27
+ and prior backup-operations
28
+
29
+ ## General usage of the BackupParadise project - backing up data via ruby
30
+
31
+ For the time being, I have aliased the main executable
32
+ called **backup_paradise** onto:
33
+
34
+ backup_paradise
35
+
36
+ To then use this, I can do:
37
+
38
+ backup_paradise usb1
39
+ backup_paradise usb2
40
+ backup_paradise tousb3
41
+ backup_paradise tousb4
42
+
43
+ Depending on where the **external USB device** is mounted.
44
+
45
+ Presently (December 2018) these entries are hardcoded
46
+ towards e. g. <b>/Mount/USB1/</b>, <b>/Mount/USB2/</b> and
47
+ so forth. They can be accessed via shortcuts as well, such
48
+ as "usb1" or "tousb1", without the quotes. See the examples
49
+ listed above.
50
+
51
+ Other mount points can also be used, although not with a
52
+ convenient shortcut. Have a look at the option
53
+ **--backup-to=/opt/** documented elsewhere in this file.
54
+
55
+ ## Backing up individual directories
56
+
57
+ If you have a directory called **FOOBAR/**, then you can back
58
+ it up simply by issuing:
59
+
60
+ backup_paradise --FOOBAR
61
+ backup_paradise FOOBAR
62
+
63
+ Whichever variant you prefer. Note that this requires that the
64
+ external device has been mounted already. You can set where
65
+ the device should reside via:
66
+
67
+ BackupParadise.set_mounted_path()
68
+
69
+ Simply pass the directory that you may wish to use for backup
70
+ purpose there.
71
+
72
+ Note that **class AdvancedBackup** will assume a certain target
73
+ device automatically, tailored to my own system. This is usually
74
+ at **/Mount/USB1** for the first mounted USB device on my
75
+ system.
76
+
77
+ If you wish to overrule that and use another target, which you
78
+ may most likely want to do, then you can use any of the
79
+ following commandline flags for this:
80
+
81
+ backup_paradise --use-this-as-target-for-backup=/opt/
82
+ backup_paradise --use-this-as-target=/opt/
83
+ backup_paradise --backup-to=/opt/
84
+
85
+ In this case **/opt/** would be the target that you use as **source
86
+ directory** for the backup-operation.
87
+
88
+ If you wish to backup the **/Programs/** hierarchy, should you
89
+ keep an **AppDir layout** on your system, then this commandline
90
+ invocation may be of help:
91
+
92
+ backup_paradise --programs-dir
93
+
94
+ To backup the **/Users/x/STUDIUM/** directory, the following
95
+ commands are possible:
96
+
97
+ backup_paradise --studium-dir
98
+ backup_paradise --studium-directory
99
+ backup_paradise --studium
100
+
101
+ ## Log files
102
+
103
+ The BackupParadise project will try to log as to what has happened,
104
+ since **May 2018**. Several different log files may be created.
105
+
106
+ If there is more than one log file stored at the target device
107
+ then the current behaviour is to delete all but one log file.
108
+
109
+ Another log file that may commonly be used is the one
110
+ that targets the file <b>/Depot/Temp/backup.log</b>. This
111
+ will, however had, only work if the directory **/Depot/Temp/**
112
+ exists, which is the case on my home system. The whole gem here
113
+ is heavily tailored to my own needs - I can adapt it to meet
114
+ other people's wishes if necessary, of course.
115
+
116
+ The **format** of the log file going into **backup.log** is
117
+ simply how long it took to make the backup, in seconds, and
118
+ the exact date when that particular log file was created. This
119
+ is equal to when the backup-operation happened, too.
120
+
121
+ ## GUI components
122
+
123
+ Right now the GTK3 version is the most advanced GUI part
124
+ of this project - but it is still very limited. Before I
125
+ can improve it, I have to update the code I used to
126
+ maintain gtk2/gtk3 bindings, since some of this is
127
+ broken right now.
128
+
129
+ You can try to invoke the GUI components from the commandline,
130
+ possibly via any of the following flags:
131
+
132
+ advanced_backup --gui
133
+ backup_paradise --GUI
134
+ backup_paradise --gui
135
+
136
+ ## Miscellaneous comments
137
+
138
+ The **BackupParadise** project has been rewritten a few times already
139
+ over the years.
140
+
141
+ In the past there was an instance variable in class AdvancedBackup
142
+ called **@last_backup_directory**, which was pointing to an absolute
143
+ path such as **/Mount/USB1/last_backup-13.08.2018-21:11:15/**. It is
144
+ no longer in use, but I keep it as a reference hint to myself - who
145
+ knows what may be changed in the future.
146
+
147
+ ## Specific examples
148
+
149
+ This subsection details some invocation examples in a short way.
150
+
151
+ Some of these will only work on my home system for the time being,
152
+ until I have sufficiently changed the project to allow more
153
+ flexibility in this regard.
154
+
155
+ Backup all audio-files to **/opt/**:
156
+
157
+ backup_paradise --backup-to=/opt/ --audio-dir
158
+
159
+ Backup all relevant entries into the default chroot target (on
160
+ my home system):
161
+
162
+ backup_paradise --chroot
163
+
164
+ ## How I make use of this project
165
+
166
+ I make use of the **advanced_backup** project to back up relevant
167
+ data on my home system. For example, all source-archives that
168
+ are registered in the RBT project I also keep locally. Then
169
+ there is my ruby code, other files, and possibly the largest
170
+ share these days are books in .pdf format. These are simpler
171
+ to keep about rather than having lots of hardcopy-paper
172
+ books.
173
+
174
+ In September 2020, the regular backup size was **54G** per
175
+ backup-action. This is too much, in my opinion, because
176
+ it takes about half an hour or so to back up on USB 2.0.
177
+ I will have to keep reducing file size and removing stuff
178
+ that I no longer need; aka do some clean-up. At any rate,
179
+ this subsection shows just a bit how I may use the project.
180
+
181
+ My usual go-to alias is:
182
+
183
+ rbackup usb1
184
+
185
+ to backup to the mount point /Mount/USB1.
186
+
187
+ ## class BackupParadise::AdvancedBackup
188
+
189
+ This class is the main interface for the BackupParadise project.
190
+
191
+ For a list of documented options, pass in **--help**.
192
+
193
+ A few examples will be mentioned here as well, in a succinct
194
+ manner:
195
+
196
+ rbackup --pwd # backup into the current working directory
197
+
198
+ ## The configuration file
199
+
200
+ The **BackupParadise project** comes with a small configuration file,
201
+ called **config.yml**. This is optional, though - it it does
202
+ not exist then the project will ignore this file completely.
203
+
204
+ Presently (at the least since as of **December 2018**), that
205
+ configuration file specifies only the following **three
206
+ configuration settings**:
207
+
208
+ use_this_program_to_rename_tabs: String
209
+ show_popup_notification: Boolean
210
+ use_system_cp: Boolean
211
+
212
+ More options may be added in the future, but I will try to only
213
+ add options that make sense, rather than overwhelm users with
214
+ lots of configuration options.
215
+
216
+
217
+ ## Contact information
218
+
219
+ If your creative mind has ideas and specific suggestions to make this
220
+ gem more useful in general, feel free to drop me an email at any
221
+ time, via:
222
+
223
+ shevegen@gmail.com
224
+
225
+ (Do keep in mind that responding to emails may take some time, depending
226
+ on the amount of work I may have at that moment, due to reallife. I will,
227
+ however had, read feedback. Patches and code changes are welcome too
228
+ of course, as long as they are in the spirit of the project at
229
+ hand, e. g. fitting to the general theme.)
230
+
231
+ Thank you.
@@ -0,0 +1,51 @@
1
+ # =========================================================================== #
2
+ # Gemspec for Project BackupParadise.
3
+ # =========================================================================== #
4
+ require 'backup_paradise/version/version.rb'
5
+
6
+ Gem::Specification.new { |s|
7
+
8
+ s.name = 'backup_paradise'
9
+ s.version = BackupParadise::VERSION
10
+ s.date = Time.now.strftime('%Y-%m-%d')
11
+
12
+ DESCRIPTION = <<-EOF
13
+
14
+ This project can be used for backup-related tasks, although it is
15
+ primarily adjusted to my own personal use cases, so it may not
16
+ be of much use to other ruby users. Still - in the event that someone
17
+ wants to give it a try or re-use existing ideas for inspiration,
18
+ feel free to have a look at it.
19
+
20
+ For more documentation have a look at the official
21
+ homepage, at:
22
+
23
+ https://www.rubydoc.info/gems/backup_paradise/
24
+
25
+ EOF
26
+
27
+ s.summary = DESCRIPTION
28
+ s.description = DESCRIPTION
29
+
30
+ s.extra_rdoc_files = %w()
31
+
32
+ s.executables = Dir['bin/*'].map { |f| File.basename(f) }
33
+
34
+ s.authors = ['Robert A. Heiler']
35
+ s.email = 'shevegen@gmail.com'
36
+ s.files = Dir['**/*']
37
+ s.license = 'GPL-2.0'
38
+ s.homepage = 'http://rubygems.org/gems/backup_paradise'
39
+
40
+ s.required_ruby_version = '>= '+RUBY_VERSION
41
+ s.required_rubygems_version = '>= '+Gem::VERSION
42
+ s.rubygems_version = '>= '+Gem::VERSION
43
+
44
+ s.add_dependency 'colours'
45
+ s.add_dependency 'convert_global_env'
46
+ s.add_dependency 'mountpoints'
47
+ s.add_dependency 'opn'
48
+ s.add_dependency 'roebe'
49
+ s.add_dependency 'save_file'
50
+
51
+ }
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ require 'backup_paradise'
6
+
7
+ BackupParadise::AdvancedBackup.new(ARGV)
data/doc/README.gen ADDED
@@ -0,0 +1,214 @@
1
+ # Backup Paradise
2
+
3
+ ADD_RUBY_HEADER
4
+
5
+ This project attempts to assist you - and me - in backing up data
6
+ to an **external USB** device.
7
+
8
+ Do note that the project is currently catering to my own use cases,
9
+ so it may not be very useful to other ruby users. I may make
10
+ adjustments for other ruby users, but this may take some time.
11
+
12
+ The project is primarily just a fancy **recursive copy** operation,
13
+ but it will do some minor additional notifications on the commandline,
14
+ use colours (if the colours gem has been installed), automatically
15
+ create some log files and even provide some semi-complete ruby-gtk
16
+ bindings. So it is a **recursive copy** script with some add-ons.
17
+
18
+ The project has **one major goal** and a **few minor goals**. The major
19
+ goal is to be usable as a backup-assistant.
20
+
21
+ The **minor goals** include:
22
+
23
+ - Flexibility (to back up only individual files or directories)
24
+ - Notify the user about the status of the backup-operation
25
+ and prior backup-operations
26
+
27
+ ## General usage of the BackupParadise project - backing up data via ruby
28
+
29
+ For the time being, I have aliased the main executable
30
+ called **backup_paradise** onto:
31
+
32
+ backup_paradise
33
+
34
+ To then use this, I can do:
35
+
36
+ backup_paradise usb1
37
+ backup_paradise usb2
38
+ backup_paradise tousb3
39
+ backup_paradise tousb4
40
+
41
+ Depending on where the **external USB device** is mounted.
42
+
43
+ Presently (December 2018) these entries are hardcoded
44
+ towards e. g. <b>/Mount/USB1/</b>, <b>/Mount/USB2/</b> and
45
+ so forth. They can be accessed via shortcuts as well, such
46
+ as "usb1" or "tousb1", without the quotes. See the examples
47
+ listed above.
48
+
49
+ Other mount points can also be used, although not with a
50
+ convenient shortcut. Have a look at the option
51
+ **--backup-to=/opt/** documented elsewhere in this file.
52
+
53
+ ## Backing up individual directories
54
+
55
+ If you have a directory called **FOOBAR/**, then you can back
56
+ it up simply by issuing:
57
+
58
+ backup_paradise --FOOBAR
59
+ backup_paradise FOOBAR
60
+
61
+ Whichever variant you prefer. Note that this requires that the
62
+ external device has been mounted already. You can set where
63
+ the device should reside via:
64
+
65
+ BackupParadise.set_mounted_path()
66
+
67
+ Simply pass the directory that you may wish to use for backup
68
+ purpose there.
69
+
70
+ Note that **class AdvancedBackup** will assume a certain target
71
+ device automatically, tailored to my own system. This is usually
72
+ at **/Mount/USB1** for the first mounted USB device on my
73
+ system.
74
+
75
+ If you wish to overrule that and use another target, which you
76
+ may most likely want to do, then you can use any of the
77
+ following commandline flags for this:
78
+
79
+ backup_paradise --use-this-as-target-for-backup=/opt/
80
+ backup_paradise --use-this-as-target=/opt/
81
+ backup_paradise --backup-to=/opt/
82
+
83
+ In this case **/opt/** would be the target that you use as **source
84
+ directory** for the backup-operation.
85
+
86
+ If you wish to backup the **/Programs/** hierarchy, should you
87
+ keep an **AppDir layout** on your system, then this commandline
88
+ invocation may be of help:
89
+
90
+ backup_paradise --programs-dir
91
+
92
+ To backup the **/Users/x/STUDIUM/** directory, the following
93
+ commands are possible:
94
+
95
+ backup_paradise --studium-dir
96
+ backup_paradise --studium-directory
97
+ backup_paradise --studium
98
+
99
+ ## Log files
100
+
101
+ The BackupParadise project will try to log as to what has happened,
102
+ since **May 2018**. Several different log files may be created.
103
+
104
+ If there is more than one log file stored at the target device
105
+ then the current behaviour is to delete all but one log file.
106
+
107
+ Another log file that may commonly be used is the one
108
+ that targets the file <b>/Depot/Temp/backup.log</b>. This
109
+ will, however had, only work if the directory **/Depot/Temp/**
110
+ exists, which is the case on my home system. The whole gem here
111
+ is heavily tailored to my own needs - I can adapt it to meet
112
+ other people's wishes if necessary, of course.
113
+
114
+ The **format** of the log file going into **backup.log** is
115
+ simply how long it took to make the backup, in seconds, and
116
+ the exact date when that particular log file was created. This
117
+ is equal to when the backup-operation happened, too.
118
+
119
+ ## GUI components
120
+
121
+ Right now the GTK3 version is the most advanced GUI part
122
+ of this project - but it is still very limited. Before I
123
+ can improve it, I have to update the code I used to
124
+ maintain gtk2/gtk3 bindings, since some of this is
125
+ broken right now.
126
+
127
+ You can try to invoke the GUI components from the commandline,
128
+ possibly via any of the following flags:
129
+
130
+ advanced_backup --gui
131
+ backup_paradise --GUI
132
+ backup_paradise --gui
133
+
134
+ ## Miscellaneous comments
135
+
136
+ The **BackupParadise** project has been rewritten a few times already
137
+ over the years.
138
+
139
+ In the past there was an instance variable in class AdvancedBackup
140
+ called **@last_backup_directory**, which was pointing to an absolute
141
+ path such as **/Mount/USB1/last_backup-13.08.2018-21:11:15/**. It is
142
+ no longer in use, but I keep it as a reference hint to myself - who
143
+ knows what may be changed in the future.
144
+
145
+ ## Specific examples
146
+
147
+ This subsection details some invocation examples in a short way.
148
+
149
+ Some of these will only work on my home system for the time being,
150
+ until I have sufficiently changed the project to allow more
151
+ flexibility in this regard.
152
+
153
+ Backup all audio-files to **/opt/**:
154
+
155
+ backup_paradise --backup-to=/opt/ --audio-dir
156
+
157
+ Backup all relevant entries into the default chroot target (on
158
+ my home system):
159
+
160
+ backup_paradise --chroot
161
+
162
+ ## How I make use of this project
163
+
164
+ I make use of the **advanced_backup** project to back up relevant
165
+ data on my home system. For example, all source-archives that
166
+ are registered in the RBT project I also keep locally. Then
167
+ there is my ruby code, other files, and possibly the largest
168
+ share these days are books in .pdf format. These are simpler
169
+ to keep about rather than having lots of hardcopy-paper
170
+ books.
171
+
172
+ In September 2020, the regular backup size was **54G** per
173
+ backup-action. This is too much, in my opinion, because
174
+ it takes about half an hour or so to back up on USB 2.0.
175
+ I will have to keep reducing file size and removing stuff
176
+ that I no longer need; aka do some clean-up. At any rate,
177
+ this subsection shows just a bit how I may use the project.
178
+
179
+ My usual go-to alias is:
180
+
181
+ rbackup usb1
182
+
183
+ to backup to the mount point /Mount/USB1.
184
+
185
+ ## class BackupParadise::AdvancedBackup
186
+
187
+ This class is the main interface for the BackupParadise project.
188
+
189
+ For a list of documented options, pass in **--help**.
190
+
191
+ A few examples will be mentioned here as well, in a succinct
192
+ manner:
193
+
194
+ rbackup --pwd # backup into the current working directory
195
+
196
+ ## The configuration file
197
+
198
+ The **BackupParadise project** comes with a small configuration file,
199
+ called **config.yml**. This is optional, though - it it does
200
+ not exist then the project will ignore this file completely.
201
+
202
+ Presently (at the least since as of **December 2018**), that
203
+ configuration file specifies only the following **three
204
+ configuration settings**:
205
+
206
+ use_this_program_to_rename_tabs: String
207
+ show_popup_notification: Boolean
208
+ use_system_cp: Boolean
209
+
210
+ More options may be added in the future, but I will try to only
211
+ add options that make sense, rather than overwhelm users with
212
+ lots of configuration options.
213
+
214
+ ADD_CONTACT_INFORMATION