Skip to content
New issue

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

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

Already on GitHub? # to your account

Reading File Info - Linux OS #771

Open
mrdm-nl opened this issue Sep 27, 2023 · 1 comment
Open

Reading File Info - Linux OS #771

mrdm-nl opened this issue Sep 27, 2023 · 1 comment

Comments

@mrdm-nl
Copy link

mrdm-nl commented Sep 27, 2023

Reading File Info - Linux OS

SQL Server all version and edition running on Linux
Microsoft SQL Server 2019 (RTM-CU22) (KB5027702) - 15.0.4322.2 (X64) Jul 27 2023 18:11:00 Copyright (C) 2019 Microsoft Corporation Web Edition (64-bit) on Linux (Ubuntu 20.04.6 LTS)
This issue is valid when non Sysadmin users want to make backup

Version of the script
2022-01-02 13:58:13

What command are you executing?
in DatabaseBackup is executed
INSERT INTO @DirectoryInfo (FileExists, FileIsADirectory, ParentDirectoryExists)
EXECUTE [master].dbo.xp_fileexist @CurrentRootDirectoryPath) -- '/linux/folder'

What output are you getting?
File_Exists = 0, FileIsDirectory = 0, ParentDirExists = 0

**Suppposed working Solution **
using newer sys.dm_os_file_exists
INSERT INTO @DirectoryInfo (FileExists, FileIsADirectory, ParentDirectoryExists)
(SELECT * FROM sys.dm_os_file_exists(@CurrentRootDirectoryPath))

@olahallengren
Copy link
Owner

I guess I should be using the new DMF on SQL Server 2017 and later, on Windows and Linux.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants