I need to copy files from a computer folder to a network share folder. It's for a backup.
Can you write a bash script that could do the task every day in 11 PM? Also the script should figure out which files are already copied.
Sure! Here's a sample bash script that should accomplish the task:

```bash
#!/bin/bash

# Source and destination folders
source_folder=/path/to/computer/folder
destination_folder=/path/to/network/share/folder

# Check if destination folder exists, create it if it doesn't
if [ ! -d "$destination_folder" ]; then
  mkdir -p "$destination_folder"
fi

# Copy only new and modified files
rsync -av --update "$source_folder" "$destination_folder"

# Add a log entry
echo "$(date): Backup completed" >> /var/log/backup.log
```

To run this script every day at 11 PM, you can use a cron job. To edit your crontab file, run `crontab -e` in the terminal and add the following line:

javascript

0 23 * * * /path/to/backup_script.sh

This will run the script at 11 PM every day. The `0` at the beginning specifies that it should run at the exact minute (0th minute), and the `*` for the other fields means it should run every day of the month and every month.

The `rsync` command used in the script will only copy files that are new or have been modified since the last backup. This means you don't have to worry about copying files that are already backed up.

The script also adds a log entry to `/var/log/backup.log` with the current date and time when the backup is completed, so you can check the log to make sure the backup ran successfully.