mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-07-12 21:45:47 +00:00
uploader demo
This commit is contained in:
34
src/ahriman/core/upload/rsync.py
Normal file
34
src/ahriman/core/upload/rsync.py
Normal file
@ -0,0 +1,34 @@
|
||||
#
|
||||
# Copyright (c) 2021 Evgenii Alekseev.
|
||||
#
|
||||
# This file is part of ahriman
|
||||
# (see https://github.com/arcan1s/ahriman).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
from ahriman.core.configuration import Configuration
|
||||
from ahriman.core.upload.uploader import Uploader
|
||||
from ahriman.core.util import check_output
|
||||
|
||||
|
||||
class Rsync(Uploader):
|
||||
|
||||
def __init__(self, config: Configuration) -> None:
|
||||
Uploader.__init__(self, config)
|
||||
self.remote = self.config.get('rsync', 'remote')
|
||||
|
||||
def sync(self, path: str) -> None:
|
||||
check_output('rsync', '--archive', '--verbose', '--compress', '--partial', '--progress', '--delete', path, self.remote,
|
||||
exception=None,
|
||||
logger=self.logger)
|
Reference in New Issue
Block a user