Skip to content

Commit

Permalink
Added full path for btrfs
Browse files Browse the repository at this point in the history
So that it can run from cron
  • Loading branch information
djotaku committed Mar 9, 2020
1 parent 798339b commit 22cd697
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ Go back to previous year -> cull to one per quarter

6 March import:

For culling: use sorted(glob result)


Dev steps:
Full Code coverage on current code (pytest all or ignore line - like w/ if __name__ == __main__
Local Culling / unit tests
Expand Down
2 changes: 1 addition & 1 deletion snapintime/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__author__ = "Eric Mesa"
__version__ = "0.8.1"
__version__ = "0.8.2"
__license__ = "GNU GPL v3.0"
__copyright__ = "(c) 2014 Eric Mesa"
__email__ = "ericsbinaryworld at gmail dot com"
2 changes: 1 addition & 1 deletion snapintime/culling.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def btrfs_del(directory: str, subvols: list) -> list:
return_list = []
if len(subvols) > 0:
for subvol in subvols:
command = f"btrfs sub del {directory}/{subvol}"
command = f"/usr/sbin/btrfs sub del {directory}/{subvol}"
try:
raw_result = subprocess.run(command, capture_output=True, shell=True, check=True, text=True)
return_text = f"Ran {raw_result.args} with a return code of {raw_result.returncode}.\n"\
Expand Down
2 changes: 1 addition & 1 deletion snapintime/remote_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def btrfs_send_receive(local_subvols: list, remote_subvol: str, backup_location:
:returns: A dictionary with the result of the command.
"""
sorted_local = sorted(local_subvols)
command = f"btrfs send -p {backup_location}/{remote_subvol} {backup_location}/{sorted_local[-1]} | ssh {remote_location} btrfs receive {remote_subvol_dir}"
command = f"/usr/sbin/btrfs send -p {backup_location}/{remote_subvol} {backup_location}/{sorted_local[-1]} | ssh {remote_location} btrfs receive {remote_subvol_dir}"
try:
raw_result = subprocess.run(command, capture_output=True, shell=True, check=True, text=True)
result = {"Command": raw_result.args, "Return Code": raw_result.returncode, "Output": raw_result.stdout}
Expand Down

0 comments on commit 22cd697

Please sign in to comment.