Steps to copy the file from source and destination comparison
Create the script with backup.sh
#!/bin/bash
current_files=$(ls)
destination_files=$(ls “$destination_folder”)
for file in $current_files; do
if [[ -f “$destination_folder/$file” ]]; then
mv “$destination_folder/$file” “$backup_folder”
fi
done
Save the script :wq
Change the permission $ chmod 755 backup.sh