mirror of https://github.com/tteck/Proxmox.git
				
				
				
			Update cron-update-lxcs.sh
This script is designed to schedule a cron job that updates all LXCs every Sunday at midnight.
This commit is contained in:
		
							parent
							
								
									891bf6fe9f
								
							
						
					
					
						commit
						ba966fdff8
					
				| 
						 | 
					@ -18,14 +18,14 @@ EOF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
add() {
 | 
					add() {
 | 
				
			||||||
while true; do
 | 
					while true; do
 | 
				
			||||||
  read -p "This script will add a cron job to update all LXCs at midnight. Proceed(y/n)?" yn
 | 
					  read -p "This script will schedule a cron job that updates all LXCs every Sunday at midnight. Proceed(y/n)?" yn
 | 
				
			||||||
  case $yn in
 | 
					  case $yn in
 | 
				
			||||||
  [Yy]*) break ;;
 | 
					  [Yy]*) break ;;
 | 
				
			||||||
  [Nn]*) exit ;;
 | 
					  [Nn]*) exit ;;
 | 
				
			||||||
  *) echo "Please answer yes or no." ;;
 | 
					  *) echo "Please answer yes or no." ;;
 | 
				
			||||||
  esac
 | 
					  esac
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
sh -c '(crontab -l -u root 2>/dev/null; echo "0 0 * * * PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin /bin/bash -c \"\$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/update-lxcs-cron.sh)\" >>/var/log/update-lxcs-cron.log 2>/dev/null") | crontab -u root -'
 | 
					sh -c '(crontab -l -u root 2>/dev/null; echo "0 0 * * 0 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin /bin/bash -c \"\$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/update-lxcs-cron.sh)\" >>/var/log/update-lxcs-cron.log 2>/dev/null") | crontab -u root -'
 | 
				
			||||||
clear
 | 
					clear
 | 
				
			||||||
echo -e "\n To view Update LXCs Cron logs: cat /var/log/update-lxcs-cron.log"
 | 
					echo -e "\n To view Update LXCs Cron logs: cat /var/log/update-lxcs-cron.log"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue