Bash scripting 8 – Backup
So moving on, making backups of files is generally a good idea, especially with the scripts we have been making
echo "Basic backup script"
echo
append=-bak # set text to append to file
echo "list files"
echo
ls
echo
for file in *.JPG # apply to all files ending with JPG
do
filename="${file%.*}"
cp $file ${filename}.JPG$append
done
echo "backed up files"
ls
Tags
#Bash,#Bashscripting,#BatchProcessing,#Backup
| Mastodon | ShellLabs | Join Mastodon |