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

what is my syntax error? #92

Open
naddel91 opened this issue Oct 12, 2024 · 20 comments
Open

what is my syntax error? #92

naddel91 opened this issue Oct 12, 2024 · 20 comments

Comments

@naddel91
Copy link

thanks for your script. but I cannot make it work. it does not execute after powershell command it entered. is it due to my custom folders?

plex script

@alekdavis
Copy link
Owner

  1. When you define the setting in the configuration file, you need to assign them to the value properties, not to the default properties under the _meta element (these just show what the default values are). So, just move values from lines 23 and 29 to lines 25 and 30 (replace null values with your values).
  2. Which version of PowerShell are you using? From PowerShell window, run $PSVersionTable and it will show the version. If you are using version 7, then it's probably the reason. It did not work for me and I did not have time to port the script to PowerShell 7 (it's on the todo list, but no promises at this point)
  3. If you are running PowerShell 5.x, please post a screenshot of what happens and we'll go from there.

@naddel91
Copy link
Author

naddel91 commented Oct 12, 2024

thanks for your help. still nothing:

nothing

$PSVersionTable says 5.1

@alekdavis
Copy link
Owner

alekdavis commented Oct 12, 2024

I think you have a typo in the BackupRootDir setting (unless you intentionally called the folder Backu).

That's not how you run PowerShell scripts. First, move the PlexBackup.ps1 file somewhere to a dedicated directory, so it is not mingled with other application or data files. I would recommend creating a separate folder. If you insist on using the K drive, just go to the root of the K drive and create a PlexBackup folder and move the PlexBackup.ps1 and PlexBackup.ps1.json files there. Then from PowerShell command prompt, switch to this folder so it is your active directory and enter .\PlexBackup.ps1. This should work.

@naddel91
Copy link
Author

P:\Backu is intentional. My P-Key did hang when I created that folder. So I named it that in the script. ".\PlexBackup.ps1" or ".\PlexBackup.ps"?

@alekdavis
Copy link
Owner

alekdavis commented Oct 12, 2024

Sorry, ps1. It was my typo.

@naddel91
Copy link
Author

Backup.log

@alekdavis
Copy link
Owner

Do you have 7zip installed?

@naddel91
Copy link
Author

yes, and set to PATH as well.

@alekdavis
Copy link
Owner

Did you specify the path to the 7zip EXE in the in the config file?

@naddel91
Copy link
Author

"},
"Type": {
"_meta": {
"set": ",7zip,Robocopy",
"default": """

here?

@alekdavis
Copy link
Owner

No, under:

"ArchiverPath": {
        "_meta": {
            "default": "$env:ProgramFiles\\7-Zip\\7z.exe"
        },
        "value": ""HERE!!!"
    },

@naddel91
Copy link
Author

I have the default dir, so no value needed, right?

@naddel91
Copy link
Author

7zip

@naddel91
Copy link
Author

7zip2

The .exe file is definetely there!

@alekdavis
Copy link
Owner

If it's the default installation dir, then, no, not needed (and if you specify it, it must include the exe file). But the log indicates that it fails to archive the first (Cache) directory (I assume you have no files to archive under the root folder, which is normally the case). So, normally, 7zip should provide some info why it failed, but in your case, I see nothing. So, it's really weird. I would run it with the -Verbose switch to see if there is any additional info. You can also try the default archiver (do not use the switch to indicate 7zip compression) and see if it does better. If I ran into this problem, I would add a log statement before line 2992 and print out the command the script uses and try to run it manually. Or try compressing the cache folder via 7zip by hand.

@naddel91
Copy link
Author

can I leave out cache folder? I thought it would be excluded by default?

@alekdavis
Copy link
Owner

According to your screenshot, 7-zip path should be under C:\Programme\7-zip\7z.exe, not under C:\Program Files\7-zip\7z.exe. But I suspect it would not matter (since the default did not cause this error).

@alekdavis
Copy link
Owner

alekdavis commented Oct 12, 2024

You can exclude the Cache folder, but it is important: it stores all of you custom configurations. You can exclude it as a troubleshooting step (to see if it may be locked or something), but I would not exclude it for normal operation.

@naddel91
Copy link
Author

ok, will backup with "-verbose" and report back tomorrow. thanks for your time.

@alekdavis
Copy link
Owner

OK. Also, run it with the -RawOutput switch. Maybe it will give us additional info from 7zip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants