Skip to content

Instantly share code, notes, and snippets.

@pahud
Created January 2, 2019 07:25
Show Gist options
  • Save pahud/8db37ed1ad435bc400a106de090e98a8 to your computer and use it in GitHub Desktop.
Save pahud/8db37ed1ad435bc400a106de090e98a8 to your computer and use it in GitHub Desktop.
mirror your local dir to S3 via sftp with lftp
#!/bin/bash
open_lftp(){
lftp sftp://pahud:@s-xxxxxxxxxxxxxx.server.transfer.eu-central-1.amazonaws.com "$@"
}
backup_canon1(){
open_lftp -e "ls; cd EOS_DIGITAL/DCIM/100CANON/; mirror -R --only-newer --ignore-time /Volumes/2T-BLACK/Norway2018/Canon_M50/backup01/ .;exit;"
}
backup_canon2(){
open_lftp -e "ls; cd EOS_DIGITAL/DCIM/100CANON/; mirror -R --only-newer --ignore-time /Volumes/2T-BLACK/Norway2018/Canon_M50/backup02/ .;exit;"
}
backup_canon3(){
open_lftp -e "ls; cd EOS_DIGITAL/DCIM/100CANON/; mirror -R --only-newer --ignore-time /Volumes/2T-BLACK/Norway2018/Canon_M50/backup03/ .;exit;"
}
backup_canon4(){
open_lftp -e "ls; cd EOS_DIGITAL/DCIM/100CANON/; mirror -R --only-newer --ignore-time /Volumes/2T-BLACK/Norway2018/Canon_M50/backup04/ .;exit;"
}
backup_canon5(){
open_lftp -e "ls; cd EOS_DIGITAL/DCIM/100CANON/; mirror -R --only-newer --ignore-time /Volumes/2T-BLACK/Norway2018/Canon_M50/backup05/ .;exit;"
}
backup_sony(){
open_lftp -e "ls; cd Sony/; mirror -R --only-newer --ignore-time /Volumes/2T-BLACK/Norway2018/Sony/ .;exit;"
}
backup_dji(){
open_lftp -e "ls; cd DJI/; mirror -R --only-newer --ignore-time /Volumes/2T-BLACK/Norway2018/DJI-Original-Backup/ .;exit;"
}
get_dji(){
open_lftp -e "ls; mirror -c --only-newer --ignore-time DJI /Volumes/3TUSB/NorwayBackup;exit;"
}
backup_djisdcard(){
open_lftp -e "ls; cd DJI/100MEDIA/; mirror -R --only-newer --ignore-time /Volumes/Untitled/DCIM/100MEDIA/ .; exit;"
}
# backup_canon1
# backup_canon2
# backup_canon3
# backup_canon4
# backup_canon5
# backup_sony
#backup_dji
#backup_djisdcard
get_dji
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment