Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Usage: ./deleteOld "bucketname" "30 days"
s3cmd ls s3://$1 | while read -r line;
do
createDate=`echo $line|awk {'print $1" "$2'}`
createDate=`date -d"$createDate" +%s`
olderThan=`date -d"-$2" +%s`
if [[ $createDate -lt $olderThan ]]
@mokemokechicken
mokemokechicken / rc_script_sample.sh
Created November 6, 2012 06:44
Sysvinit script sample
#!/bin/sh
### BEGIN INIT INFO
# Provides: gunicorn_scweb
# Required-Start: $network $local_fs
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: SimpleCounter Web
# Description: Yumemi Inc.
#### END INIT INFO