Storage über shell aktivieren/deaktivieren

lenny30

Member
May 26, 2020
106
8
23
43
Hallo zusammen,
kann man ein eingerichtetes Storage über die Shell aktivieren bzw. deaktivieren?

Dankeschön!
 
ja - mit `pvesm set <storagename> -disable 0` (bzw. disable 1 zum aktivieren)
siehe auch man pvesm

Ich hoffe das hilft!
 
klasse, das hilft - jedoch 1 zum deaktivieren und 0 zum aktivieren - zumindest bei mir. Super und Danke!
stimmt - sorry fürs verwechseln - freut mich, dass es klappt :)
 
eins ist mir doch aufgefallen, wenn ich das Ganze über cron steuern möchte, sei es direkt als Befehl oder in einem Skript - funktioniert es einfach nicht.
 
eins ist mir doch aufgefallen, wenn ich das Ganze über cron steuern möchte, sei es direkt als Befehl oder in einem Skript - funktioniert es einfach nicht
wundert mich - kannst du den cronjob mal teilen?
Eine Sache, die da oft problematisch ist, ist das cronjobs prinzpiell nur "/usr/bin:/bin" als PATH haben - siehe crontab(5)

Ich hoffe das hilft!
 
55 11 * * 6 /home/m_hdd_aktiv.sh 12 14 * * * pvesm set m_hdd2 -disable 0

inhalt vom skript:
#media hdd aktiv setzen pvesm set m_hdd2 -disable 0 # 60 Minuten aktiv lassen für Backup sleep 60m #hdd deaktiv setzen pvesm set m_hdd2 -disable 1


wenn der Befehl direkt abgesetzt wird, klappt es problemlos
 
pvesm set m_hdd2 -disable 0
wie gesagt - siehe `man 5 crontab`:
PATH is set to "/usr/bin:/bin"

und :
Code:
# which pvesm
/usr/sbin/pvesm

sprich einfach mal den absoluten pfad eintragen: `/usr/sbin/pvesm set m_hdd2 -disable 1`

ich hoffe das erklärt es
 
  • Like
Reactions: lenny30

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!