uglygus / rsync-time-browse

Find file changes within hardlinked backups like timemachine
MIT License
4 stars 2 forks source link

Execution problem #2

Closed calamarim closed 2 years ago

calamarim commented 2 years ago

Hi,

I use currently rsync-time-backup, but rsync-time-browse do not work for me, and for sure I am missing something needed; someone can point me to the problem please?

:~$ /home/xxx/rsync-time-browse/tmbrowse.py -h File "/home/xxx/rsync-time-browse/tmbrowse.py", line 26 while chunk := f.read(8192): ^ SyntaxError: invalid syntax

while

:~$ /home/xxx/rsync-time-backup/rsync_tmbackup.sh -h Usage: rsync_tmbackup.sh [OPTION]... [USER@HOST:]SOURCE [USER@HOST:]DESTINATION [exclude-pattern-file] Options -p, --port SSH port. ...

This is my environment,

Linux 5.10.0-11-amd64 #1 SMP Debian 5.10.92-1 (2022-01-18) x86_64 GNU/Linux debian_version 11.2 python --version Python 3.7.3

uglygus commented 2 years ago

The walrus operator on line 26 is only available after Python 3.8. I removed it. Clone the repo again and retry.

Coincidentally I just installed a fresh Debian install and it came with Python 3.9.2

xxx@debian:~/code/rsync-time-browse$ uname -a
Linux debian 5.10.0-11-amd64 #1 SMP Debian 5.10.92-1 (2022-01-18) x86_64 GNU/Linux
cooper@debian:~/code/rsync-time-browse$ python3 --version
Python 3.9.2
calamarim commented 2 years ago

Now it works, thanks, but output is just this. Tested on past environment and another one; same result.

/home/pi/tmbrowse.py ./backup_Xdati/latest/bil/5p.ods

/media/pi/backup_X/latest/bil/5p.ods 24 backups at root: /media/pi/backup_Xdati

uglygus commented 2 years ago

I think I got it. Give the current repo a try and let me know if it works.

Explanation: The 'latest' folder is a symlink and it gets expanded on osx automatically but not on linux. os.path.realpth() replaces it with the original.

calamarim commented 2 years ago

Now it works perfectly. :-) Just another hint, the "latest" folder looks like the most "natural" folder where choose the file argument. Maybe I'm wrong. What is your normal choice for this?

Many, many thanks

uglygus commented 2 years ago

It can be any folder. If the file you want was recently deleted it won't necessarily be in latest.

Off topic but I just realized you can also use wildcards... tmbrowse.py ./latest/foo/*.txt Will report on every text file in folder foo.

I'm thinking of expanding this wildcard capabilities. So you could use a wildcard to find across the whole repo not just a single folder.