AWS S3 backup script

Published on Author admin

Start with updating AWS CLI tool: pip3 install awscli --upgrade --user Script for backing up data into your AWS S3 bucket: #!/bin/bash pathtobackup='/home/USERNAME/data/' pathtoarchivefile='/home/USERNAME' filenameprefix='backup-nextcloud' secret='secretpassword' awsbucket='awsbucket-name' date=`date --iso-8601` archivefilename=$filenameprefix-$date.7z echo echo "Performing backup of $pathtobackup to s3://$awsbucket/$archivefilename" echo echo `date -Is` echo "Compressing $pathtobackup to $pathtoarchivefile/$archivefilename" echo 7za a $pathtoarchivefile/$archivefilename $pathtobackup -p$secret echo echo… Continue reading AWS S3 backup script

Nextcloud - upgrade to 13.0beta1

Published on Author admin

Upgrading Nextcloud from CLI on Linux system with systemd. /var/www/html/owncloud/ - Nextcloud installation directory apache - HTTP server service user cd /var/www/html/ wget https://download.nextcloud.com/server/prereleases/nextcloud-13.0.0beta1.zip systemctl stop httpd rm owncloud-old/ -rf mv owncloud/ owncloud-old/ unzip nextcloud-13.0.0beta1.zip mv nextcloud/ owncloud/ mv owncloud-old/data/ owncloud/data/ cp owncloud-old/config/config.php owncloud/config/config.php chown apache: owncloud/ -R chcon -R -t httpd_sys_rw_content_t /data/var/www/html/owncloud/config chcon -R… Continue reading Nextcloud - upgrade to 13.0beta1

Using AWS EC2 CLI - part 2

Published on Author admin

Using AWS EC2 CLI - part 2 Script for checking VMs status: https://github.com/openterprise/scripts/blob/master/aws-status.sh Example user data file script: https://github.com/openterprise/scripts/blob/master/aws-user-data.sh #create VM centos aws ec2 run-instances --image-id ami-18f8df7d --security-group-ids sg-ID --subnet-id subnet-ID --count 1 --instance-type t2.micro --key-name KEY-NAME --user-data file://aws-user-data.sh --block-device-mappings 'DeviceName=/dev/sda1,Ebs={VolumeSize=10,DeleteOnTermination=false}' --query 'Instances[0].InstanceId' #stop ALL instances (only those are running) aws ec2 stop-instances --instance-ids `aws… Continue reading Using AWS EC2 CLI - part 2