initial commit
rodzic
c5ec9d586b
commit
a43238af18
|
@ -0,0 +1,26 @@
|
|||
from python_on_whales import docker
|
||||
import datetime
|
||||
import sys
|
||||
import pathlib
|
||||
|
||||
|
||||
now = "{date:%Y%m%d-%H%M%S}".format( date=datetime.datetime.now() )
|
||||
|
||||
source_volume = "friendica_db"
|
||||
archive_filename = source_volume + "-" + now
|
||||
archive_bind = pathlib.Path().resolve()
|
||||
archive_path = str(archive_bind) + "/" + archive_filename
|
||||
|
||||
image = "loomchild/volume-backup"
|
||||
command = ["backup",
|
||||
"-c", "gz",
|
||||
archive_filename]
|
||||
volumes = [ (source_volume,"/volume"),
|
||||
(archive_bind, "/backup") ]
|
||||
|
||||
print("Archive volume: ", source_volume, " to file: ", archive_path)
|
||||
|
||||
out=docker.run(image=image,
|
||||
command=command,
|
||||
volumes=volumes)
|
||||
|
Ładowanie…
Reference in New Issue