Command copy needs 2 arguments maximum: you provided 3 non flag arguments: error how to fix it?

What is the problem you are having with rclone?

Command copy needs 2 arguments maximum: you provided 3 non flag arguments: ["/home/exodrive.zapbase.innn/backup/backup-exodriv-12-15-03-Sat-Jun-2022.tar.gz" "/home/exodrive.zapbase.innn/backup/backup-exodriv-12-15-05-Sat-Jun-2022.tar.gz" "gdrive:basezapnovanodebackups/vps.mailez.io/2022-06-04/exodrive.zapbase.innn"]

Run the command 'rclone version' and share the full output of the command.

rclone v1.55.1

  • os/type: linux
  • os/arch: amd64
  • go/version: go1.16.3
  • go/linking: static
  • go/tags: none

Which cloud storage system are you using? (eg Google Drive)

gdrive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

Paste command here

The rclone config contents with secrets removed.

Paste config here

A log from the command with the -vv flag

Paste  log here

hello sir ,
i m using cyberpanel script to create the backup on the gdive but now it showing this error that is attached above please help me to short out this

This appears to have two files and one destination in the command line. You can only copy 1 file at once.

but sir in the other servers its working fine there is also we have 3 or 4 sites we are using same script

Maybe there are more files in the home/exodrive.zapbase.innn/backup/ directory than the script expects?

noo sir this is empty at this but when we run the script so tar file will come here and after upload to the gdrive script automatically empty the backup folder

still not able to find the solution?

Can you share the full command you are trying?

echo "~~~~~~~~~~~~~~ Starting BACKUP Creation and Upload to Google Drive ~~~~~~~~~~~~~~"
echo $DATE
start=$SECONDS
ls -1 /var/cpanel/users -Isystem | while read user; do
/scripts/pkgacct $user $BACKUP_DIR/$DATE --backup --skiplogs --skipbwdata --nocompress > /dev/null 2>> /root/gdrive-backup-cpanel/user.log
wait
rclone copy $BACKUP_DIR/$DATE gdrive:basezap"$NODE"nodebackups/$SERVER_HOSTNAME/$DATE > /dev/null 2>> /root/gdrive-backup-cpanel/user.log
wait

Remove backup file

rm -f $BACKUP_DIR/$DATE/* > /dev/null 2>> /root/gdrive-backup-cpanel/user.log
wait
if [[ -s /root/gdrive-backup-cpanel/user.log ]]; then
echo -e "$TO\n$FROM\nMessage-ID: $MID@bz\nSubject: Backup Failed - $SERVER_HOSTNAME\n\n$user Backup Failed" | ssmtp $NOTIFY_TO
fi

Update temp.log with user.log

cat /root/gdrive-backup-cpanel/user.log >> /root/gdrive-backup-cpanel/temp.log

Remove user log file

rm -f /root/gdrive-backup-cpanel/user.log
wait
done
if [[ -s /root/gdrive-backup-cpanel/temp.log ]]; then
echo -e "$TO\n$FROM\nMessage-ID: $MID@bz\nSubject: Backup Failed - $SERVER_HOSTNAME\n\nFull Backup Failed and Incomplete" | ssmtp $NOTIFY_TO
else
echo -e "$TO\n$FROM\nMessage-ID: $MID@bz\nSubject: Backup Success - $SERVER_HOSTNAME\n\nFull Backup Success" | ssmtp $NOTIFY_TO
fi

Update temp.log in back.log and remove temp log file

cat /root/gdrive-backup-cpanel/temp.log >> /root/gdrive-backup-cpanel/backup.log && rm -f /root/gdrive-backup-cpanel/temp.log
echo "~~~~~~~~~~~~~~ Backup Creation and Upload to Google Drive Finished ~~~~~~~~~~

using this script

That's the script you are using.

Can you share the full command that runs as the output?

The rclone copy part as that looks to be what is wrong. Most likely a bad environment variable or something.

2022-06-04
Usage:
rclone copy source:path dest:path [flags]

Flags:
--create-empty-src-dirs Create empty source dirs on destination after copy
-h, --help help for copy

Use "rclone [command] --help" for more information about a command.
Use "rclone help flags" for to see the global flags.
Use "rclone help backends" for a list of supported services.
Command copy needs 2 arguments maximum: you provided 3 non flag arguments: ["/home/exodrive.zapbase.innn/backup/backup-exodriv-12-15-03-Sat-Jun-2022.tar.gz" "/home/exodrive.zapbase.innn/backup/backup-exodriv-12-15-05-Sat-Jun-2022.tar.gz" "gdrive:basezapnovanodebackups/vps.mailez.io/2022-06-04/exodrive.zapbase.innn"]

Total Time Taken 530 Seconds
~~~~~~~~~~~~~~ Starting BACKUP Creation and Upload to Google Drive ~~~~~~~~~~~~~~
2022-06-05
Usage:
  rclone copy source:path dest:path [flags]

Flags:
      --create-empty-src-dirs   Create empty source dirs on destination after copy
  -h, --help                    help for copy

Use "rclone [command] --help" for more information about a command.
Use "rclone help flags" for to see the global flags.
Use "rclone help backends" for a list of supported services.
Command copy needs 2 arguments maximum: you provided 3 non flag arguments: ["/home/exodrive.zapbase.innn/backup/backup-exodriv-12-15-03-Sun-Jun-2022.tar.gz" "/home/exodrive.zapbase.innn/backup/backup-exodriv-12-15-05-Sun-Jun-2022.tar.gz" "gdrive:basezapnovanodebackups/vps.mailez.io/2022-06-05/exodrive.zapbase.innn"]
~~~~~~~~~~~~~~ Backup Creation and Upload to Google Drive Finished ~~~~~~~~~~~~~~
Total Time Taken 521 Seconds
~~~~~~~~~~~~~~ Starting BACKUP Creation and Upload to Google Drive ~~~~~~~~~~~~~~

Sorry as that's the output of the command.

Need the actual command being run.

If it's a bash script, you can add "-x" on the end.

Example:

felix@gemini:~$ cat blah
#!/usr/bin/bash -x
ls -al /home/felix/test
felix@gemini:~$ ./blah
+ ls -al /home/felix/test
total 0
drwxrwxr-x 1 felix felix   0 May 29 16:03 .
drwxr-x--- 1 felix felix 270 Jun  7 08:04 ..

We need the actual command as it's entered as that's going to tell you what's wrong.