Find Jobs
Hire Freelancers

Amazon EC2 API Delete Snapshot Script Fix

$30-250 USD

Abgeschlossen
Veröffentlicht vor mehr als 5 Jahren

$30-250 USD

Bezahlt bei Lieferung
Hi, I have a script that is suppose delete snapshots older than 60 days in aws that stopped working probably due to an amazon api update. The error is aws: error: argument --snapshot-id is required I've pasted the script below. #!/bin/bash #export EC2_PRIVATE_KEY=**** #export EC2_CERT=**** #export EC2_URL=**** #export AWS_ACCESS_**** #export AWS_SECRET_KEY=**** #export REGION=**** #export EC2_HOME=/opt/aws/apitools/ec2 #export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64 MAILADDR=**** DIR="/root/scripts" CURRENT_DATE=$(date +%Y-%m-%d); # We now prunning backups older than 60 days aws ec2 describe-snapshots | grep `date +%Y-%m-%d --date '60 days ago'` | awk {'print $2'} > $DIR/[login to view URL] LIST=`cat $DIR/[login to view URL] | wc -l` if [ $LIST -eq "0" ]; then echo "No snapshots older than 60 days have been found on your server." | mail -s "Deleted Snapshots notification - $CURRENT_DATE" -r reports@**** $MAILADDR exit else echo "Deleted Snapshots:" > $DIR/[login to view URL] echo "" >> $DIR/[login to view URL] for i in `cat $DIR/[login to view URL]` do aws ec2 delete-snapshot $i echo $i : Deleted >> $DIR/[login to view URL] done #cat $DIR/[login to view URL] | mail -s "Deleted Snapshots notification - $CURRENT_DATE" -r reports@**** $MAILADDR fi aws: error: argument --snapshot-id is required
Projekt-ID: 17803521

Über das Projekt

11 Vorschläge
Remote Projekt
Aktiv vor 6 Jahren

Möchten Sie etwas Geld verdienen?

Vorteile einer Ausschreibung auf Freelancer

Legen Sie Ihr Budget und Ihren Zeitrahmen fest
Für Ihre Arbeit bezahlt werden
Skizzieren Sie Ihren Vorschlag
Sie können sich kostenlos anmelden und auf Aufträge bieten
Vergeben an:
Avatar des Nutzers
hello i will change the coding to get the error fixed and the snapshots older than 60 days would be deleted.. please message me back to discuss details and i am ready to get started..
$50 USD in 1 Tag
4,9 (272 Bewertungen)
6,3
6,3
11 Freelancer bieten im Durchschnitt $110 USD für diesen Auftrag
Avatar des Nutzers
Amazon web services expert
$49 USD in 1 Tag
5,0 (37 Bewertungen)
5,7
5,7
Avatar des Nutzers
hi, Looking to your bash scripts, there are something incorrect - If your run aws ec2 describe-snapshots | grep `date +%Y-%m-%d --date '60 days ago'` | awk {'print $2'} it just displays the snapshort created time like "2018-07-22T22:52:21.000Z",` ""2018-07-22T22:52:21.000Z", "2018-07-22T04:52:41.000Z", "2018-07-22T03:35:03.000Z", "2018-07-22T08:02:48.000Z", "2018-07-22T10:47:21.000Z", "2018-07-22T09:57:40.000Z", "2018-07-22T09:36:40.000Z", "2018-07-22T08:37:33.000Z", "2018-07-22T04:37:41.000Z"," And also, this just display all snapshorts created at "2018-07-22", not older than "2018-07-22" That means, your filter is not correct: one is just displays timestamp created of snapshots, two is just displays snapshorts were created at exact 60 days ago. - So, if you would like to fix it at exact 60 days ago (as your current logic), you can try to replace: "aws ec2 describe-snapshots | grep `date +%Y-%m-%d --date '60 days ago'` | awk {'print $2'}" by "aws ec2 describe-snapshots --query "Snapshots[*].{ID:SnapshotId,TIME:StartTime}" | grep `date +%Y-%m-%d --date '60 days ago'` -B1 | grep snap | awk -F\" '{print $4}'" You will see it will display snapshots list. And if you would like to fix completely, I can help you on this task within 1 day or 2. Regards, --T
$94 USD in 1 Tag
5,0 (18 Bewertungen)
4,5
4,5
Avatar des Nutzers
I specialize in Linux administration and internet technologies. I have been assisting companies to meet their technology needs for more than 14 years, and I have over 20 years of IT experience on a global scale. I am very skilled with Apache, Nginx, MySQL, and Postgres. I have a large amount of application experience with languages such as PHP, Perl, Python and can resolve your snapshot issue quickly. Please don't hesitate to contact me regarding this project's fulfillment, or any other future projects you may have.
$155 USD in 1 Tag
5,0 (20 Bewertungen)
4,7
4,7
Avatar des Nutzers
Hello I am working in Scripting technologies for years. I worked in various Unix Shells (c shell, bash korn), perl and python. Can we talk further on this? Thank you!
$220 USD in 3 Tagen
4,8 (9 Bewertungen)
3,9
3,9
Avatar des Nutzers
I have been in this field for more than 7 years. I have experience in C#, PHP, Perl,LARAVEL, WordPress, Html, Postgres, Python, Ubuntu, Crontab, Web Services, Xero, Rest API, Zend, AWS API Gateway, Lambda, AWS Server, MWS API, Yii, Mysql. Relevant Skills and Experience so I am the right candidate for your project because I have experience in C#,Perl,LARAVEL,php,node.js, Ubuntu, Crontab, Cryptocurrency, Python, Wordpress, eBay, AWS API Gateway, Lambda, AWS Server, MWS API, Instagram, Mysql, Sqllite, Mongo Db, Xero API.
$122 USD in 1 Tag
4,2 (7 Bewertungen)
4,1
4,1
Avatar des Nutzers
I have a script do the same work with you, can fix your script within 1 day, please help share what your snapshot look like first, i also need permission access snapshot in AWS
$55 USD in 3 Tagen
5,0 (1 Bewertung)
1,1
1,1
Avatar des Nutzers
I can give you a new script to delete the snapshot based on retention period(how many days you want to search for eg: 60 days)
$166 USD in 1 Tag
0,0 (0 Bewertungen)
0,0
0,0
Avatar des Nutzers
Hello, It seems the describe-snapshots command returns different output and later the delete command fails because of that (can't find snapshot id). I can quickly fix the script and demonstrate it to you on may env. I am not aware if there is specific use case but I would suggest another approach for deleting EBS snapshots - easy and automatic process. You can write me to discuss both ways. A little about me, I am senior software engineer with AWS extensive experience. Through the years I've worked with different technologies and programing languages. I am also AWS Certified Developer. I see this task as easy and fast. I usually would place more expensive bid but I am searching for a long term professional relationships and I want to prove my skills. My bid remains as is even if this is going to be one time job. Best Regards. Georgi Velinov
$40 USD in 1 Tag
0,0 (0 Bewertungen)
0,0
0,0
Avatar des Nutzers
Hi Mate, I am AWS certified Associate and can sort you out this snapshot deletion issue quick. Please let me know if you are interested. Relevant Skills and Experience AWS Certified Associate, working in AWS projects which uses service like EC2,RDS,Redshifts,etc...
$100 USD in 3 Tagen
0,0 (0 Bewertungen)
0,0
0,0

Über den Kunden

Flagge von CANADA
Vancouver, Canada
5,0
178
Zahlungsmethode verifiziert
Mitglied seit Feb. 19, 2006

Kundenüberprüfung

Danke! Wir haben Ihnen per E-Mail einen Link geschickt, über den Sie Ihr kostenloses Guthaben anfordern können.
Beim Senden Ihrer E-Mail ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.
Registrierte Benutzer Veröffentlichte Jobs
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Vorschau wird geladen
Erlaubnis zur Geolokalisierung erteilt.
Ihre Anmeldesitzung ist abgelaufen und Sie wurden abgemeldet. Bitte melden Sie sich erneut an.