mis la command nextcloud occ scan en settings avec info ssh
This commit is contained in:
@@ -52,3 +52,9 @@ run du srv en ligne de cmd:
|
||||
```
|
||||
poetry run deezer-downloader --config .\deezer_downloader\settings.ini
|
||||
```
|
||||
|
||||
sur serveur NextCloud:
|
||||
```
|
||||
visudo
|
||||
nextclouddeezer ALL=(www-data) NOPASSWD: /usr/bin/php
|
||||
```
|
||||
@@ -9,14 +9,14 @@ def call_scan(directory_path):
|
||||
port = config['nextcloud_ssh_scan_files']['port']
|
||||
username = config['nextcloud_ssh_scan_files']['username']
|
||||
password = config['nextcloud_ssh_scan_files']['password']
|
||||
occCmd= config['nextcloud_ssh_scan_files']['occ_path']
|
||||
|
||||
directory_path = os.path.dirname(directory_path)
|
||||
directory_path = directory_path.replace(config['download_dirs']['base'] + "\\", "")
|
||||
print("Path Nexcloud Scan " + directory_path)
|
||||
# Commande à exécuter
|
||||
cmd = 'sudo /home/nextclouddeezer/scan_deezerDl_folder.sh "{dir}"'.format(dir=directory_path)
|
||||
|
||||
# Création de la connexion SSH
|
||||
# Commande à exécuter
|
||||
cmd = "sudo -u www-data php {occ} files:scan --path='{dir}'".format(occ= occCmd,dir=directory_path)
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # accepter clés inconnues
|
||||
ssh.connect(hostname=host, port=port, username=username, password=password)
|
||||
|
||||
Reference in New Issue
Block a user