Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backup.ps1 is freezing - maybe recycle bin related #25

Open
fbreve opened this issue May 13, 2020 · 6 comments
Open

backup.ps1 is freezing - maybe recycle bin related #25

fbreve opened this issue May 13, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@fbreve
Copy link

fbreve commented May 13, 2020

Hello,

I'm trying to use backup.ps1, but it is freezing. Apparently it can't move the log folder to the recycle bin. This is my last log file:

`2020-05-13 04:01:28.066 Folder does not exist. It has just been created
2020-05-13 04:01:28.140
2020-05-13 04:01:28.146
2020-05-13 04:01:28.152 =================================================================
2020-05-13 04:01:28.157 ==== Starting Duplicacy Backup @ D:\Tools\Duplicacy
2020-05-13 04:01:28.172 ====
2020-05-13 04:01:28.178 ==== Start time is: 2020-05-13 04:01:28
2020-05-13 04:01:28.183 =================================================================
2020-05-13 04:01:28.188 === doRemoteNotifications
2020-05-13 04:01:28.195 === doTelegramNotification

StatusCode : 200
StatusDescription : OK
Content : {}

2020-05-13 04:01:31.166 Zipping (and then deleting) the folder: D:\Tools\Duplicacy.duplicacy\tbp-logs\2020-05-11 segunda-feira to the zipFile: D:\Tools\Duplicacy.duplicacy\tbp-logs\2020-05-11 segunda-feira.zip
2020-05-13 04:01:34.839 OS is Windows => sending file to Recycle Bin`

@fbreve
Copy link
Author

fbreve commented May 13, 2020

I did some googling and apparently the problem is in this line:
$item.InvokeVerb("delete")

This command waits for a confirmation that never arrives.

@TheBestPessimist
Copy link
Owner

So, the weird thing is i have never had this problem on 10+ of my systems.

How are you running backup.ps1? Are you running it manually from powershell, doubleclicking or va task scheduler? Could it be that there's something wrong with file/folder permissions?

@fbreve
Copy link
Author

fbreve commented May 16, 2020

I'm running it through Task Scheduler, with my account with administrator role.

I don't think it's related to permissions because I removed the If/Else statement so the following line would be called in any system:
doCall { Remove-Item -Path $fullName -Recurse -Verbose *>&1 }

Now everything works just fine, except that the log files are deleted instead of moved to the recycle bin.

@fbreve
Copy link
Author

fbreve commented May 31, 2020

I installed your script in another system and got the exact same error, but now I know what is going on. The Recycle Bin has an option to show a confirmation dialog before sending files to it. This was on by default since the Recycle Bin was created on Windows 95. Somewhere on the road, Microsoft changed the default (Windows 8 if I recall correctly).

I didn't like the new default. It is too easy to delete files by mistake in Windows Explorer, so I set all my systems to show the confirmation dialog. Actually it is an option that is now ported with the Microsoft account, so I don't even have to configure it in every machine.

So, when your script runs with the Recycle Bin confirmation option active, it will stop and wait for the confirmation forever. The confirmation dialog doesn't actually show up since the script is running unattended.

Besides this issue, I have other suggestions, that maybe belong in another thread, but they are not exactly issues like:

  • deleting old zip files to avoid hundreds of old logs.
  • showing the machine name on Telegram notifications, since there is no way to tell which machine the notification is about as it is.

@TheBestPessimist
Copy link
Owner

Microsoft changed the default

I like not having to confirm so much <3.

Anyway, thanks so much for keeping at this, and figuring it out in the end. Will try to fix it somehow, now that the actual issue is discovered.

deleting old zip files to avoid hundreds of old logs.

I could add an option for this, but i'm against enabling it by default. If something bad happens, i would totally like to know it, even if it happened 1 year ago.

showing the machine name on Telegram notifications

The way i'm using notifications is I'm interested in the name of the folder. That tells me though about the machine.

image

What would you like to see? the hostname?

@fbreve
Copy link
Author

fbreve commented May 31, 2020

Yes, the hostname would work for me. I have the same path on both machines I set so far, so they are indistinguishable in the Telegram notifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants