question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: Backup not created if .trash is empty

See original GitHub issue

Bug Description

Thanks for the amazing workflow! When I run the obackup command, if my $vault_path/.trash folder is empty, the backup command will appear to run, but no backup is created. If the $vault_path/.trash folder is not empty, the backup is created successfully.

I believe the problem is line 16 of scripts/obsidian-backup.sh: if [[ "$itemCount" != "0" ]] ; then. It appears to evaluate to “true” even when the .trash folder is empty. When I changed line 16 to if (( ${itemCount} != 0 )) ; then, the backup worked correctly both when .trash was empty and when it had items in it.

Relevant Screenshot

No response

To Reproduce

No response

Debugging Log

[14:11:33.988] Shimmering Obsidian[Script Filter] Queuing argument ‘(null)’ [14:11:34.746] Shimmering Obsidian[Keyword] Processing complete [14:11:34.762] Shimmering Obsidian[Keyword] Passing output ‘’ to Post Notification [14:11:34.763] Shimmering Obsidian[Post Notification] Processing complete [14:11:34.764] Shimmering Obsidian[Post Notification] Passing output ‘’ to Run Script [14:11:34.848] STDERR: Shimmering Obsidian[Run Script] mkdir: /Users/christyray/Library/Mobile Documents/iCloud~md~obsidian/Documents/Notes/.trash: File exists /Users/christyray/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.67A5BC3A-139E-46C4-A1F2-E42D30566510/scripts/obsidian-backup.sh:17: no matches found: ./.trash/* [14:11:34.867] Shimmering Obsidian[Run Script] Processing complete [14:11:34.869] Shimmering Obsidian[Run Script] Passing output '/Users/christyray/Scripts/Obsidian-Backup/Obsidian-Backup_2022-02-04_14-11.zip ’ to Post Notification [14:11:34.870] Shimmering Obsidian[Post Notification] Processing complete [14:11:34.871] Shimmering Obsidian[Post Notification] Passing output '/Users/christyray/Scripts/Obsidian-Backup/Obsidian-Backup_2022-02-04_14-11.zip ’ to Play Sound [14:11:34.942] Shimmering Obsidian[Play Sound] Processing complete [14:11:34.957] Shimmering Obsidian[Play Sound] Passing output '/Users/christyray/Scripts/Obsidian-Backup/Obsidian-Backup_2022-02-04_14-11.zip ’ to Call External Trigger [14:11:34.958] Shimmering Obsidian[External] Processing complete [14:11:34.959] Shimmering Obsidian[External] Passing output '/Users/christyray/Scripts/Obsidian-Backup/Obsidian-Backup_2022-02-04_14-11.zip ’ to Conditional [14:11:34.961] Shimmering Obsidian[Conditional] Processing complete [14:11:34.962] Shimmering Obsidian[Conditional] Passing output '/Users/christyray/Scripts/Obsidian-Backup/Obsidian-Backup_2022-02-04_14-11.zip ’ to Run Script

Workflow Configuration

The ends of some of the paths are cut off, but I don’t believe they are part of the issue. image

Version & System Information

-------------------------------
Metadata JSONs: 3/3
-------------------------------
INSTALLED VERSION
macOS: 12.1
Obsidian: 0.13.24
Alfred: 4.6.2
Workflow: 2.20.1
Advanced URI Plugin: 1.17.0
Metadata Extractor: 0.3.1
-------------------------------
LATEST VERSION
Obsidian: 0.13.23
Obsidian (Insider): 0.13.24
Workflow: 2.20.2
Advanced URI Plugin: 1.17.0
Metadata Extractor: 0.3.1
-------------------------------

Make sure you have done the following

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
chrisgriesercommented, Feb 4, 2022

okay, I tried some workaround in release 2.20.4, which should hopefully update the keyword properly (also closing this, since the original bug has been resolved, thanks again for fixing it!)

0reactions
chrisgriesercommented, Feb 4, 2022

And, unrelated, the bug report template asks for oinfo, but I think it meant oversions instead?

I changed the keyword for that one, I think it’s some sort of bug for Alfred, that changes in keywords do not get updated properly sometimes 🙁 If you uninstall the workflow and do a clean install (instead of installing the newest version while you have the workflow already installed), it gets updated properly. I’ll look into whether I can maybe find a workaround for that…

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix the 'some items in the trash cannot be deleted' ...
The 'Some items in the trash cannot be deleted' error message most commonly appears when you manually delete Time Machine backups. Time Machine ......
Read more >
Unable to Empty Trash and Delete Time Machine Backups ...
Manually Empty Trash when Time Machine Backup Files are Stuck. This requires the use of force delete through the Terminal, which makes it...
Read more >
Help! Mac Trash Bin Won't Let Me Empty it, How to Fix?
One of the most likely reasons is that your Mac has encountered a glitch somewhere, so emptying the Trash doesn't work properly.
Read more >
trash will not empty with backups.backup file in it
I made a backup of my old Mac Pro, on an external hard drive. I attached the external hard drive to my new...
Read more >
20.10 - Trash Bin does not work properly
Looks like a glitch/bug. Since you mentioned that you can open the trash, and empty it from there, that might be your best...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found