Class: Backup::Storage::GoogleDrive
- Inherits:
-
Base
- Object
- Base
- Backup::Storage::GoogleDrive
- Includes:
- Storage::Cycler
- Defined in:
- lib/backup-googledrive.rb
Defined Under Namespace
Classes: Error
Instance Attribute Summary collapse
-
#chunk_size ⇒ Object
Chunk size, specified in bytes (power of two, i.e. 8M = 8 * 1024 * 1024).
-
#max_retries ⇒ Object
Number of times to retry failed operations.
-
#rclone_config ⇒ Object
Path to the rclone config file.
-
#rclone_drive ⇒ Object
Name of the rclone remote drive.
-
#rclone_exec ⇒ Object
Path to the rclone executable.
Instance Method Summary collapse
-
#initialize(model, storage_id = nil) ⇒ GoogleDrive
constructor
Creates a new instance of the storage object.
Constructor Details
#initialize(model, storage_id = nil) ⇒ GoogleDrive
Creates a new instance of the storage object
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/backup-googledrive.rb', line 33 def initialize(model, storage_id = nil) super @rclone_exec ||= "/usr/bin/rclone" @rclone_config ||= "/root/.config/rclone/rclone.conf" @rclone_drive ||= "remote" @path ||= "" @chunk_size ||= 8388608 @max_retries ||= 3 @cmd_base = "#{rclone_exec} --config #{rclone_config} --retries #{max_retries} --drive-chunk-size=#{chunk_size} --drive-use-trash=false" path.sub!(/^\//, "") end |
Instance Attribute Details
#chunk_size ⇒ Object
Chunk size, specified in bytes (power of two, i.e. 8M = 8 * 1024 * 1024)
23 24 25 |
# File 'lib/backup-googledrive.rb', line 23 def chunk_size @chunk_size end |
#max_retries ⇒ Object
Number of times to retry failed operations.
Default: 10
29 30 31 |
# File 'lib/backup-googledrive.rb', line 29 def max_retries @max_retries end |
#rclone_config ⇒ Object
Path to the rclone config file
15 16 17 |
# File 'lib/backup-googledrive.rb', line 15 def rclone_config @rclone_config end |
#rclone_drive ⇒ Object
Name of the rclone remote drive
19 20 21 |
# File 'lib/backup-googledrive.rb', line 19 def rclone_drive @rclone_drive end |
#rclone_exec ⇒ Object
Path to the rclone executable
11 12 13 |
# File 'lib/backup-googledrive.rb', line 11 def rclone_exec @rclone_exec end |