6 Commits

Author SHA1 Message Date
e62a668f3e Update metadata 2025-03-30 14:39:59 +02:00
bd8934d57f Update version tag 2025-03-30 14:38:56 +02:00
96fe3c7813 Update man page 2025-03-30 14:38:29 +02:00
9fdb959540 Improve handling of user detection failure 2025-03-30 14:37:30 +02:00
eb889beee7 Add Python 3.13 to setup.cfg 2025-03-30 12:16:04 +02:00
2a37eb4172 Add PKGBUILD 2024-11-13 19:38:12 +01:00
5 changed files with 55 additions and 6 deletions

40
PKGBUILD Normal file
View File

@ -0,0 +1,40 @@
# PKGBUILD
# Maintainer: Daniele Fucini <dfucini [at] gmail [dot] com>
pkgname=simple_backup
pkgdesc='Simple backup script that uses rsync to copy files'
pkgver=4.1.5
pkgrel=1
url="https://github.com/Fuxino/${pkgname}"
arch=('any')
license=('GPL-3.0-or-later')
makedepends=('git'
'python-setuptools'
'python-build'
'python-installer'
'python-wheel')
depends=('python>=3.10'
'rsync'
'python-dotenv')
optdepends=('python-systemd: use systemd log'
'python-dbus: for desktop notifications'
'python-paramiko: for remote backup through ssh')
conflicts=('simple_backup-git')
source=(git+${url}?signed#tag=${pkgver})
validpgpkeys=('7E12BC1FF3B6EDB2CD8053EB981A2B2A3BBF5514')
sha256sums=('4da838282fff813f82ee0408996c989078a206eabce07112b4e3ee8b057e34cf')
build()
{
cd ${srcdir}/${pkgname}
python -m build --wheel --no-isolation
}
package()
{
cd ${srcdir}/${pkgname}
python -m installer --destdir=${pkgdir} dist/*.whl
install -Dm644 ${pkgname}/${pkgname}.conf ${pkgdir}/usr/share/doc/${pkgname}/${pkgname}.conf
install -Dm644 man/${pkgname}.1 ${pkgdir}/usr/share/man/man1/${pkgname}.1
}

View File

@ -1,4 +1,4 @@
.TH SIMPLE_BACKUP 1 2023-06-15 SIMPLE_BACKUP 3.2.6 .TH SIMPLE_BACKUP 1 2025-03-30 SIMPLE_BACKUP 4.1.6
.SH NAME .SH NAME
simple_backup \- Backup files and folders using rsync simple_backup \- Backup files and folders using rsync
.SH SYNOPSIS .SH SYNOPSIS
@ -187,6 +187,6 @@ Bad configuration file.
.SH SEE ALSO .SH SEE ALSO
.BR rsync (1) .BR rsync (1)
.SH AUTHORS .SH AUTHORS
.MT https://github.com/Fuxino .MT https://git.shouldnt.work/fuxino
Daniele Fucini Daniele Fucini
.ME .ME

View File

@ -6,7 +6,7 @@ long_description = file: README.md
author = Daniele Fucini author = Daniele Fucini
author_email = dfucini@gmail.com author_email = dfucini@gmail.com
license = GPL3 license = GPL3
url = https://github.com/Fuxino/simple_backup url = https://git.shouldnt.work/fuxino
classifiers = classifiers =
Development Status :: 4 - Beta Development Status :: 4 - Beta
Environment :: Console Environment :: Console
@ -16,6 +16,7 @@ classifiers =
Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11 Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12 Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Topic :: System :: Archiving :: Backup Topic :: System :: Archiving :: Backup
[options] [options]

View File

@ -1,3 +1,3 @@
"""Init.""" """Init."""
__version__ = '4.1.5' __version__ = '4.1.6'

View File

@ -679,7 +679,10 @@ def _read_config(config_file, user=None):
'numeric_ids': False} 'numeric_ids': False}
if not os.path.isfile(config_file): if not os.path.isfile(config_file):
logger.warning('Config file %s does not exist', config_file) if user is not None:
logger.warning('Config file %s does not exist', config_file)
else:
logger.warning('User not specified. Can\'t read configuration file')
return config_args return config_args
@ -793,7 +796,12 @@ def simple_backup():
if euid == 0: if euid == 0:
user = os.getenv('SUDO_USER') user = os.getenv('SUDO_USER')
homedir = os.path.expanduser(f'~{user}')
if user is not None:
homedir = os.path.expanduser(f'~{user}')
else:
logger.warning('Failed to detect user. You can use -u/--user parameter to manually specify it')
homedir = None
else: else:
user = os.getenv('USER') user = os.getenv('USER')
homedir = os.getenv('HOME') homedir = os.getenv('HOME')