Last active
August 29, 2015 14:25
-
-
Save kevinSuttle/f7ffd6f3b0750e2ed5be to your computer and use it in GitHub Desktop.
Bash 3.2: copy specific file names and files with specific extensions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
declare -a backup_files=(*.{id,nsf}, desktop8.ndk archive user.dic); | |
declare -a notes_data_directory=~/Library/Application\ Support/IBM\ Notes\ Data/; | |
declare -a notes_backup_directory=~/Desktop/Notes\ Backup; | |
mkdir -p "$notes_backup_directory"; | |
cd "$notes_data_directory"; | |
for i in "${backup_files[@]}" | |
do | |
cp -nipvR "$notes_data_directory$i" "$notes_backup_directory"; | |
# find "$notes_data_directory""$i" -exec cp -nipvR {} "$notes_backup_directory" \; | |
done | |
# OUTPUT: All files are copied from the backup_files array except for .id files and .nsf files. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment