Help for script files with Synology nas

Currently reading
Help for script files with Synology nas

36
5
NAS
DS918+
Operating system
  1. Windows
Trying to teach myself how write Linux scripts to automate some of the manual processes I go through now.

I have multiple WIN 10 64 bit PC’s that ‘talk’ to multiple NAS devices. I have admin access to PC & NAS

The first box reflects the file structure (all are shared folders for admins) I see on one of the NAS devices. The directory and file structure was set up to provide descriptive names at directory, sub directory & file name levels.



I have established a SSH connection to the NAS & I see there is no user directory for the use gkellerjr, that’s me. I suspect did something wrong in the NAS setup. I suspect I am missing?

1683300765376.png



The following are screen captures from the command prompt after establishing a connection to the NAS. This is my 1st attempt in trying to do this. I want to learn by doing, but, struggling to find something that resembles what I believe is my structure on the NAS. Please go easy on me with the acronyms.
Thanks in advance.


Synology strongly advises you not to run commands as the root user, who has
the highest privileges on the system. Doing so may cause major damages
to the system. Please note that if you choose to proceed, all consequences are
at your own risk.

Could not chdir to home directory /var/services/homes/gkellerjr: No such file or directory


This is where I tried to go down & look at the /var/services/directory.

gkellerjr@GJKJRNAS:/var$ cd /var/services
gkellerjr@GJKJRNAS:/var/services$ dir
total 8
drwxr-xr-x 2 root root 4096 May 3 18:42
drwxr-xr-x 17 root root 4096 May 3 18:42 ..
lrwxrwxrwx 1 root root 18 Oct 13 2021 download -> /volume1/@download
lrwxrwxrwx 1 root root 24 Nov 25 2020 homes -> /volume1/@fake_home_link
lrwxrwxrwx+ 1 root root 18 Oct 13 2018 NetBackup -> /volume1/NetBackup
lrwxrwxrwx 1 root root 24 Oct 13 2018 pgsql -> /volume1/@database/pgsql
lrwxrwxrwx 1 root root 21 Dec 8 2021 surveillance -> /volume1/surveillance
lrwxrwxrwx 1 root root 13 May 3 18:42 tmp -> /volume1/@tmp
 

Attachments

  • 1683300737404.png
    1683300737404.png
    16.3 KB · Views: 4
You're doing this on the NAS's SSH command line? I suspect that Synology added the alias for the dir command to help PC users, it's an alias for ls -al.

Your user home folder is actually /volume1/homes/gkellerjr. Other than this, I'm not sure what help you are asking for.
 
Upvote 0
Thanks for timely response.
In response to your question; I am entering commands from the command prompt (DOS prompt) on the Win 10 PC after establishing an ssh connection to the NAS.
I was expecting to see something on the PC screen which resembled the directory & file structure I see when I go into file station on the NAS. I'm trying to get visibility into a directory(?) that reflects that level of information.
The following is what appears on the PC screen upon signing on to the NAS. It appears that the sign on process defaults to looking for the home folder as shown below. It highlighted in bold print below.

Synology strongly advises you not to run commands as the root user, who has
the highest privileges on the system. Doing so may cause major damages
to the system. Please note that if you choose to proceed, all consequences are
at your own risk.

Could not chdir to home directory /var/services/homes/gkellerjr: No such file or directory
 
Upvote 0
Last edited by a moderator:
I was expecting to see something on the PC screen which resembled the directory & file structure I see when I go into file station on the NAS. I'm trying to get visibility into a directory(?) that reflects that level of information.
To build on what @fredbert said above, the best place to start is /volume1/. This is the root folder for your various shares, and your user /home/ directories. So after connecting:

Bash:
cd /volume1/
ls -al
and this will list the folders under /volume1/

You can keep drilling down through the directory structure from there. And you dont have to keep 'cd'ing' into each new directory level; you can just view the structures directly from within the 'ls' command. So, for eg, to list all the user home dirs, ls -al /volume1/homes/ and so on.

Unless there was a particular reason for wanting to start with the /var/services/ directory?
 
Upvote 0
OK, I'm now seeing something I recognize.
There was no reason to start with the /var/services/ directory. That is the directory the NAS defaulted to after it connected via ssh. I did not select it, the NAS did.
Thanks for the clarification!
 
Upvote 0

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

OK, I think I solved it. I forgot that I installed a Nova Tenda Mesh, to connect to my security camera...
Replies
30
Views
3,341
  • Question
Many thanks to you both for taking time to respond. I really appreciate the help I’ve been given on here...
Replies
3
Views
4,370
I found the problem!!! it was a certificate problem! after deleted and created a new one all apps working...
Replies
13
Views
4,433
Anyone setting Valheim Plus with the Docker interface in Synology? I go through some instructions online...
Replies
12
Views
4,111

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Back
Top